- return true;
-}
-
-struct wimlib_capture_config *
-copy_capture_config(const struct wimlib_capture_config *config)
-{
- struct wimlib_capture_config *copy;
-
- copy = CALLOC(1, sizeof(struct wimlib_capture_config));
- if (!copy)
- goto oom;
- if (!copy_pattern_list(©->exclusion_pats, &config->exclusion_pats))
- goto oom;
- if (!copy_pattern_list(©->exclusion_exception_pats,
- &config->exclusion_exception_pats))
- goto oom;
+ 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);
+ if (ret)
+ goto out_free_capture_config;
+ *config_copy_ret = config_copy;