- config_copy = CALLOC(1, sizeof(struct wimlib_capture_config));
- if (!config_copy) {
- ret = WIMLIB_ERR_NOMEM;
- goto out_free_capture_config;
- }
- ret = copy_and_canonicalize_pattern_list(&config->exclusion_pats,
- &config_copy->exclusion_pats);
- if (ret)
- goto out_free_capture_config;
- ret = copy_and_canonicalize_pattern_list(&config->exclusion_exception_pats,
- &config_copy->exclusion_exception_pats);
+ /* [PrepopulateList] is used for apply, not capture. But since we do
+ * understand it, recognize it, thereby avoiding the unrecognized
+ * section warning, but discard the resulting strings.
+ *
+ * We currently ignore [CompressionExclusionList] and
+ * [CompressionFolderList]. This is a known issue that doesn't seem to
+ * have any real consequences, so don't issue warnings about not
+ * recognizing those sections. */
+ STRING_SET(prepopulate_pats);
+ STRING_SET(compression_exclusion_pats);
+ STRING_SET(compression_folder_pats);
+
+ struct text_file_section sections[] = {
+ {T("ExclusionList"),
+ &config->exclusion_pats},
+ {T("ExclusionException"),
+ &config->exclusion_exception_pats},
+ {T("PrepopulateList"),
+ &prepopulate_pats},
+ {T("CompressionExclusionList"),
+ &compression_exclusion_pats},
+ {T("CompressionFolderList"),
+ &compression_folder_pats},
+ };
+ void *mem;
+
+ ret = do_load_text_file(config_file, buf, bufsize, &mem,
+ sections, ARRAY_LEN(sections),
+ LOAD_TEXT_FILE_REMOVE_QUOTES, mangle_pat);