X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fcapture_common.c;h=c74c94e05358c50644afdc35f22c16c9f8007241;hb=3394534dd649ddb295ef33b8e66aa91570c485a4;hp=35aaee69a789724584b6d5f1cc8e55eca4e3e1bf;hpb=0230cefb4cee3580a705364232feb72258994237;p=wimlib diff --git a/src/capture_common.c b/src/capture_common.c index 35aaee69..c74c94e0 100644 --- a/src/capture_common.c +++ b/src/capture_common.c @@ -69,7 +69,7 @@ do_capture_progress(struct add_image_params *params, int status, } } -static int +int mangle_pat(tchar *pat, const tchar *path, unsigned long line_no) { if (!is_any_path_separator(pat[0]) && @@ -105,24 +105,30 @@ mangle_pat(tchar *pat, const tchar *path, unsigned long line_no) } int -do_read_capture_config_file(const tchar *config_file, tchar *buf, size_t buflen, - struct capture_config *config) +do_read_capture_config_file(const tchar *config_file, const void *buf, + size_t bufsize, struct capture_config *config) { int ret; + STRING_SET(prepopulate_pats); struct text_file_section sections[] = { {T("ExclusionList"), &config->exclusion_pats}, {T("ExclusionException"), &config->exclusion_exception_pats}, + {T("PrepopulateList"), + &prepopulate_pats}, }; + void *mem; - ret = do_load_text_file(config_file, buf, buflen, &buf, + ret = do_load_text_file(config_file, buf, bufsize, &mem, sections, ARRAY_LEN(sections), LOAD_TEXT_FILE_REMOVE_QUOTES, mangle_pat); if (ret) return ret; - config->buf = buf; + FREE(prepopulate_pats.strings); + + config->buf = mem; return 0; } @@ -134,7 +140,7 @@ destroy_capture_config(struct capture_config *config) FREE(config->buf); } -static bool +bool match_pattern(const tchar *path, const tchar *path_basename, const struct string_set *list)