X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fadd_image.c;h=2a7f938ec600b81178f2279eaaeaf5c49d66f89d;hp=b50b05b55400c6c01fe6d0dac616118abd73ce4a;hb=3e7f9503cec2df67295fa878f5a6230ad3871160;hpb=a230e880e0d08062c37bd73dc7eebdf9cadd615d;ds=sidebyside diff --git a/src/add_image.c b/src/add_image.c index b50b05b5..2a7f938e 100644 --- a/src/add_image.c +++ b/src/add_image.c @@ -256,11 +256,6 @@ unix_build_dentry_tree_recursive(struct wim_dentry **root_ret, struct wim_inode *inode; if (exclude_path(path, path_len, params->config, true)) { - if (params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_ROOT) { - ERROR("Cannot exclude the root directory from capture"); - ret = WIMLIB_ERR_INVALID_CAPTURE_CONFIG; - goto out; - } if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_EXCLUDE_VERBOSE) && params->progress_func) { @@ -388,7 +383,9 @@ unix_build_dentry_tree(struct wim_dentry **root_ret, return WIMLIB_ERR_STAT; } - if (!S_ISDIR(root_stbuf.st_mode)) { + if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_ROOT) && + !S_ISDIR(root_stbuf.st_mode)) + { ERROR("Root of capture \"%s\" is not a directory", root_disk_path); return WIMLIB_ERR_NOTDIR;