X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwim.c;h=97bb92a25cfe613ba44669af72ec7a48b9653b3b;hb=b072e7cbca1ccb874e22aa94e3efae37ce211939;hp=20afd389aa535f8bf604ad32bb4df9ea3b00d885;hpb=465a630d28e93b09e55ca07b1a6cae8def3b42f5;p=wimlib diff --git a/src/wim.c b/src/wim.c index 20afd389..97bb92a2 100644 --- a/src/wim.c +++ b/src/wim.c @@ -448,11 +448,9 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd, return ret; } - if (wim->hdr.total_parts != 1 && !(open_flags & WIMLIB_OPEN_FLAG_SPLIT_OK)) { - ERROR("\"%"TS"\": This WIM is part %u of a %u-part WIM", - wimfile, wim->hdr.part_number, wim->hdr.total_parts); - return WIMLIB_ERR_SPLIT_UNSUPPORTED; - } + if ((open_flags & WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT) && + (wim->hdr.total_parts != 1)) + return WIMLIB_ERR_IS_SPLIT_WIM; DEBUG("According to header, WIM contains %u images", wim->hdr.image_count); @@ -682,6 +680,9 @@ int wim_checksum_unhashed_streams(WIMStruct *wim) { int ret; + + if (!wim_has_metadata(wim)) + return 0; for (int i = 0; i < wim->hdr.image_count; i++) { struct wim_lookup_table_entry *lte, *tmp; struct wim_image_metadata *imd = wim->image_metadata[i]; @@ -714,7 +715,7 @@ can_modify_wim(WIMStruct *wim) } } if (wim->hdr.total_parts != 1) { - ERROR("Cannot modify \"%"TS"\": is part of a spanned set", + ERROR("Cannot modify \"%"TS"\": is part of a split WIM", wim->filename); return WIMLIB_ERR_WIM_IS_READONLY; }