]> wimlib.net Git - wimlib/commitdiff
read_wim_lookup_table(): Warn only once for all duplicate streams
authorEric Biggers <ebiggers3@gmail.com>
Sun, 27 Apr 2014 05:26:26 +0000 (00:26 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 27 Apr 2014 05:29:30 +0000 (00:29 -0500)
src/lookup_table.c

index 1058bf2620d1fad913740a8a8d76ec0dcbdbed91..889013e0ae4912a382354e08e6d4ce406830e0d5 100644 (file)
@@ -615,6 +615,7 @@ read_wim_lookup_table(WIMStruct *wim)
        struct wim_resource_spec *cur_rspec;
        void *buf;
        bool back_to_back_pack;
        struct wim_resource_spec *cur_rspec;
        void *buf;
        bool back_to_back_pack;
+       size_t num_duplicate_entries = 0;
 
        DEBUG("Reading lookup table.");
 
 
        DEBUG("Reading lookup table.");
 
@@ -891,8 +892,7 @@ read_wim_lookup_table(WIMStruct *wim)
                 * resource.  */
                duplicate_entry = lookup_stream(table, cur_entry->hash);
                if (duplicate_entry) {
                 * resource.  */
                duplicate_entry = lookup_stream(table, cur_entry->hash);
                if (duplicate_entry) {
-                       WARNING("The WIM lookup table contains two entries "
-                               "with the same SHA1 message digest!");
+                       num_duplicate_entries++;
                        free_lookup_table_entry(cur_entry);
                        continue;
                }
                        free_lookup_table_entry(cur_entry);
                        continue;
                }
@@ -920,6 +920,12 @@ read_wim_lookup_table(WIMStruct *wim)
                        put_image_metadata(wim->image_metadata[i], NULL);
                wim->hdr.image_count = wim->current_image;
        }
                        put_image_metadata(wim->image_metadata[i], NULL);
                wim->hdr.image_count = wim->current_image;
        }
+
+       if (num_duplicate_entries > 0) {
+               WARNING("Ignoring %zu duplicate streams in the WIM lookup table",
+                       num_duplicate_entries);
+       }
+
        DEBUG("Done reading lookup table.");
        wim->lookup_table = table;
        ret = 0;
        DEBUG("Done reading lookup table.");
        wim->lookup_table = table;
        ret = 0;