+/*
+ * capture_common.c - Mostly code to handle excluding paths from capture.
+ */
+
/*
* Copyright (C) 2013 Eric Biggers
*
* along with wimlib; if not, see http://www.gnu.org/licenses/.
*/
-#include "wimlib_internal.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
-#include <string.h>
+#include "wimlib/assert.h"
+#include "wimlib/capture.h"
+#include "wimlib/error.h"
+#include "wimlib/paths.h"
#ifdef __WIN32__
-# include "win32.h"
+# include "wimlib/win32.h" /* for fnmatch() equivalent */
#else
# include <fnmatch.h>
#endif
+#include <string.h>
+
static int
canonicalize_pattern(const tchar *pat, tchar **canonical_pat_ret)
exclude_path(const tchar *path, size_t path_len,
const struct wimlib_capture_config *config, bool exclude_prefix)
{
+ if (!config)
+ return false;
const tchar *basename = path_basename_with_len(path, path_len);
if (exclude_prefix) {
wimlib_assert(path_len >= config->_prefix_num_tchars);