overwrite_wim_inplace(): Only write new metadata resources for modified images v1.3.2
authorEric Biggers <ebiggers3@gmail.com>
Wed, 27 Mar 2013 05:39:22 +0000 (00:39 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 27 Mar 2013 05:39:22 +0000 (00:39 -0500)
src/lookup_table.c
src/write.c

index 6370f03..b22def2 100644 (file)
@@ -498,6 +498,7 @@ write_lookup_table(WIMStruct *w, int image, struct resource_entry *out_res_entry
        if (start_offset == -1)
                return WIMLIB_ERR_WRITE;
 
+       /* Write lookup table entries for metadata resources */
        if (image == WIMLIB_ALL_IMAGES) {
                start_image = 1;
                end_image = w->hdr.image_count;
@@ -516,10 +517,12 @@ write_lookup_table(WIMStruct *w, int image, struct resource_entry *out_res_entry
                        return ret;
        }
 
+       /* Write lookup table entries for other resources */
        ret = for_lookup_table_entry(w->lookup_table, write_lookup_table_entry, out);
        if (ret)
                return ret;
 
+       /* Fill in the resource entry for the lookup table itself */
        end_offset = ftello(out);
        if (end_offset == -1)
                return WIMLIB_ERR_WRITE;
index a3539dd..d985aaf 100644 (file)
@@ -1961,9 +1961,7 @@ overwrite_wim_inplace(WIMStruct *w, int write_flags,
 
        found_modified_image = false;
        for (int i = 0; i < w->hdr.image_count; i++) {
-               if (!found_modified_image)
-                       found_modified_image = w->image_metadata[i].modified;
-               if (found_modified_image) {
+               if (w->image_metadata[i].modified) {
                        select_wim_image(w, i + 1);
                        ret = write_metadata_resource(w);
                        if (ret != 0)