]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Implement wimlib_iterate_dir_tree()
[wimlib] / programs / imagex.c
index ebbb650eb1680f23c032ea016921d07f463032cd..114424e396d09630e7b4f183cfeedd8c3dd185d2 100644 (file)
@@ -1968,6 +1968,13 @@ out:
        return ret;
 }
 
+static int
+print_full_path(const struct wimlib_wim_dentry *wdentry, void *_ignore)
+{
+       tprintf(T("%"TS"\n"), wdentry->full_path);
+       return 0;
+}
+
 /* Print the files contained in an image(s) in a WIM file. */
 static int
 imagex_dir(int argc, tchar **argv)
@@ -2014,7 +2021,9 @@ imagex_dir(int argc, tchar **argv)
                image = 1;
        }
 
-       ret = wimlib_print_files(w, image);
+       ret = wimlib_iterate_dir_tree(w, image, T(""),
+                                     WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE,
+                                     print_full_path, NULL);
 out:
        wimlib_free(w);
        return ret;
@@ -2584,7 +2593,9 @@ imagex_info(int argc, tchar **argv)
                        } else {
                                tprintf(T("Marking image %d as bootable.\n"),
                                        image);
-                               wimlib_set_boot_idx(w, image);
+                               ret = wimlib_set_boot_idx(w, image);
+                               if (ret)
+                                       goto out;
                        }
                }
                if (new_name) {