]> wimlib.net Git - wimlib/blobdiff - src/dentry.c
read_dentry_tree(): Fix typo in error message
[wimlib] / src / dentry.c
index e87bfefc0b46046ecdef6622e24e9f7f5933e191..af363c45187794f0a382c33f29965dd3b4ea555b 100644 (file)
@@ -2237,7 +2237,7 @@ read_dentry_tree(const u8 * restrict metadata_resource,
        for (parent = dentry->parent; !dentry_is_root(parent); parent = parent->parent)
        {
                if (unlikely(parent->subdir_offset == cur_offset)) {
-                       ERROR("Cyclic directory structure directed: children "
+                       ERROR("Cyclic directory structure detected: children "
                              "of \"%"TS"\" coincide with children of \"%"TS"\"",
                              dentry_full_path(dentry),
                              dentry_full_path(parent));
@@ -2705,10 +2705,16 @@ image_do_iterate_dir_tree(WIMStruct *wim)
 
 /* API function documented in wimlib.h  */
 WIMLIBAPI int
-wimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *path,
+wimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *_path,
                        int flags,
                        wimlib_iterate_dir_tree_callback_t cb, void *user_ctx)
 {
+       tchar *path;
+       int ret;
+
+       path = canonicalize_wim_path(_path);
+       if (path == NULL)
+               return WIMLIB_ERR_NOMEM;
        struct image_iterate_dir_tree_ctx ctx = {
                .path = path,
                .flags = flags,
@@ -2716,7 +2722,9 @@ wimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *path,
                .user_ctx = user_ctx,
        };
        wim->private = &ctx;
-       return for_image(wim, image, image_do_iterate_dir_tree);
+       ret = for_image(wim, image, image_do_iterate_dir_tree);
+       FREE(path);
+       return ret;
 }
 
 /* Returns %true iff the metadata of @inode and @template_inode are reasonably