update_image.c: Don't set RP_FIX until all commands have finished
authorEric Biggers <ebiggers3@gmail.com>
Sat, 6 Sep 2014 05:08:47 +0000 (00:08 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 6 Sep 2014 05:08:47 +0000 (00:08 -0500)
src/update_image.c

index f14775a..9a797ec 100644 (file)
@@ -869,8 +869,6 @@ execute_add_command(struct update_command_journal *j,
 #ifdef WITH_NTFS_3G
        wim_get_current_image_metadata(wim)->ntfs_vol = ntfs_vol;
 #endif
-       if (add_flags & WIMLIB_ADD_FLAG_RPFIX)
-               wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;
        ret = 0;
        goto out_destroy_config;
 out_cleanup_after_capture:
@@ -1478,6 +1476,11 @@ wimlib_update_image(WIMStruct *wim,
         * directories, may have changed.  Call xml_update_image_info() to
         * recalculate these statistics. */
        xml_update_image_info(wim, image);
+
+       for (size_t i = 0; i < num_cmds; i++)
+               if (cmds_copy[i].op == WIMLIB_UPDATE_OP_ADD &&
+                   cmds_copy[i].add.add_flags & WIMLIB_ADD_FLAG_RPFIX)
+                       wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;
 out_free_cmds_copy:
        free_update_commands(cmds_copy, num_cmds);
 out: