X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fextract.c;h=9a43e630b7c0e3d2b840be0bc83769aafcaae29e;hp=6f49c67526183dfd6c26856a8323e42f1e32658b;hb=5d3d469e410dc5f4a28814ad231336fc174cba56;hpb=9d9c2fe60b5842825002131f4ca926024e6f0038 diff --git a/src/extract.c b/src/extract.c index 6f49c675..9a43e630 100644 --- a/src/extract.c +++ b/src/extract.c @@ -93,7 +93,7 @@ dentry_resolve_and_zero_lte_refcnt(struct wim_dentry *dentry, void *_ctx) * "resolve" the inode's streams anyway by allocating new entries. */ if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) force = true; - ret = inode_resolve_ltes(inode, ctx->wim->lookup_table, force); + ret = inode_resolve_streams(inode, ctx->wim->lookup_table, force); if (ret) return ret; for (unsigned i = 0; i <= inode->i_num_ads; i++) { @@ -1147,7 +1147,8 @@ dentry_extract_skeleton(struct wim_dentry *dentry, void *_ctx) inode_for_each_dentry(other_dentry, dentry->d_inode) { if (dentry_has_short_name(other_dentry) && !other_dentry->skeleton_extracted - && other_dentry->in_extraction_tree) + && other_dentry->in_extraction_tree + && !other_dentry->extraction_skipped) { DEBUG("Creating %"TS" before %"TS" " "to guarantee correct DOS name extraction", @@ -1507,7 +1508,7 @@ extract_streams_from_pipe(struct apply_ctx *ctx) if ((found_lte->resource_location != RESOURCE_NONEXISTENT) && !(found_lte->flags & WIM_RESHDR_FLAG_METADATA) - && (needed_lte = lookup_resource(lookup_table, found_lte->hash)) + && (needed_lte = lookup_stream(lookup_table, found_lte->hash)) && (needed_lte->out_refcnt)) { tchar *tmpfile_name = NULL; @@ -3177,11 +3178,6 @@ wimlib_extract_paths(WIMStruct *wim, wimlib_progress_func_t progress_func) { int ret; - struct append_dentry_ctx append_dentry_ctx = { - .dentries = NULL, - .num_dentries = 0, - .num_alloc_dentries = 0, - }; struct wim_dentry **trees; size_t num_trees; @@ -3201,6 +3197,13 @@ wimlib_extract_paths(WIMStruct *wim, return ret; if (extract_flags & WIMLIB_EXTRACT_FLAG_GLOB_PATHS) { + + struct append_dentry_ctx append_dentry_ctx = { + .dentries = NULL, + .num_dentries = 0, + .num_alloc_dentries = 0, + }; + u32 wildcard_flags = 0; if (extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_GLOB) @@ -3212,10 +3215,17 @@ wimlib_extract_paths(WIMStruct *wim, wildcard_flags |= WILDCARD_FLAG_CASE_INSENSITIVE; for (size_t i = 0; i < num_paths; i++) { - ret = expand_wildcard(wim, paths[i], + tchar *path = canonicalize_wim_path(paths[i]); + if (path == NULL) { + ret = WIMLIB_ERR_NOMEM; + trees = append_dentry_ctx.dentries; + goto out_free_trees; + } + ret = expand_wildcard(wim, path, append_dentry_cb, &append_dentry_ctx, wildcard_flags); + FREE(path); if (ret) { trees = append_dentry_ctx.dentries; goto out_free_trees; @@ -3229,8 +3239,16 @@ wimlib_extract_paths(WIMStruct *wim, return WIMLIB_ERR_NOMEM; for (size_t i = 0; i < num_paths; i++) { - trees[i] = get_dentry(wim, paths[i], + + tchar *path = canonicalize_wim_path(paths[i]); + if (path == NULL) { + ret = WIMLIB_ERR_NOMEM; + goto out_free_trees; + } + + trees[i] = get_dentry(wim, path, WIMLIB_CASE_PLATFORM_DEFAULT); + FREE(path); if (trees[i] == NULL) { ERROR("Path \"%"TS"\" does not exist " "in WIM image %d",