]> wimlib.net Git - wimlib/blobdiff - src/update_image.c
execute_add_command(): Correctly set WIMLIB_ADD_FLAG_ROOT
[wimlib] / src / update_image.c
index d7a289a3a0dd5f6ffe253e0b5c37b776b87ce63a..8fa82c8182146c1a9079d568283f28a7104e2bca 100644 (file)
@@ -243,11 +243,13 @@ execute_add_command(WIMStruct *wim,
                progress.scan.wim_target_path = wim_target_path;
                progress_func(WIMLIB_PROGRESS_MSG_SCAN_BEGIN, &progress);
        }
-       config->_prefix = fs_source_path;
-       config->_prefix_num_tchars = tstrlen(fs_source_path);
+       if (config) {
+               config->_prefix = fs_source_path;
+               config->_prefix_num_tchars = tstrlen(fs_source_path);
+       }
 
        if (wim_target_path[0] == T('\0'))
-               add_flags |= WIMLIB_ADD_FLAG_ROOT;
+               params.add_flags |= WIMLIB_ADD_FLAG_ROOT;
        ret = (*capture_tree)(&branch, fs_source_path, &params);
        if (ret) {
                ERROR("Failed to build dentry tree for \"%"TS"\"",