X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fcapture_common.c;h=e6b5baa45b521b3bbcd225e0fe4f119daebe3bb9;hp=431a468116decb92d4aaef4b7167f1bc9a3c45b5;hb=d55cda59032e0abe5f71cd6f16ade943d2713fee;hpb=5e2f9715d5c0e1f1c3fc30a53d14df69a8bdae4a diff --git a/src/capture_common.c b/src/capture_common.c index 431a4681..e6b5baa4 100644 --- a/src/capture_common.c +++ b/src/capture_common.c @@ -1,3 +1,7 @@ +/* + * capture_common.c - Mostly code to handle excluding paths from capture. + */ + /* * Copyright (C) 2013 Eric Biggers * @@ -17,15 +21,22 @@ * along with wimlib; if not, see http://www.gnu.org/licenses/. */ -#include "wimlib_internal.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -#include +#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 #endif +#include + static int canonicalize_pattern(const tchar *pat, tchar **canonical_pat_ret) @@ -178,6 +189,8 @@ bool 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);