]> wimlib.net Git - wimlib/blobdiff - src/extract.c
read_wim_lookup_table(): Allow multiple "subpacks" per packed run
[wimlib] / src / extract.c
index 337707223ba0fda506aa267ca908f1e1dd8cafe0..b1f62b1268ddf02434829bccd416bdd133724c35 100644 (file)
@@ -494,7 +494,8 @@ extract_streams(const tchar *path, struct apply_ctx *ctx,
                                }
                        } else {
                                ret = ctx->ops->extract_unnamed_stream(
-                                                       file_spec, lte, ctx);
+                                                       file_spec, lte, ctx,
+                                                       dentry);
                                if (ret)
                                        goto error;
                        }
@@ -2434,7 +2435,6 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
                ctx.progress.extract.target = target;
        }
 
-       ctx.progress.extract.extract_root_wim_source_path = T("");
        ctx.target_dentry = wim_root_dentry(wim);
        /* Note: ctx.target_dentry represents the dentry that gets extracted to
         * @target.  There may be none, in which case it gets set to the image
@@ -2529,6 +2529,18 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
                        goto out_destroy_stream_list;
                }
                ctx.realtarget_nchars = tstrlen(ctx.realtarget);
+       #ifdef __WIN32__
+              /* Strip trailing slashes.  If we don't do this, we may create a
+               * path with multiple consecutive backslashes, which for some
+               * reason causes Windows to report that the file cannot be found.
+               */
+               while (ctx.realtarget_nchars >= 2
+                      && ctx.realtarget[ctx.realtarget_nchars - 1] == L'\\'
+                      && ctx.realtarget[ctx.realtarget_nchars - 2] != L':')
+               {
+                       ctx.realtarget[--ctx.realtarget_nchars] = L'\0';
+               }
+       #endif
        }
 
        if (progress_func) {
@@ -2924,7 +2936,7 @@ extract_single_image(WIMStruct *wim, int image,
                     const tchar *target, int extract_flags,
                     wimlib_progress_func_t progress_func)
 {
-       const tchar *path = T("");
+       const tchar *path = WIMLIB_WIM_ROOT_PATH;
        extract_flags |= WIMLIB_EXTRACT_FLAG_IMAGEMODE;
        return do_wimlib_extract_paths(wim, image, target, &path, 1,
                                       extract_flags, progress_func);