X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fsplit.c;h=d1317cf9d44f0ce82b810e65b1f53f28852d43c7;hb=50407ddd59aa2d0906225a4526eaefbf6da8450f;hp=01bb75fc817f5ba3f211b659252e61c7c5750bf5;hpb=26c7f8bb32e4a32001d409f1693e0df016270ed5;p=wimlib diff --git a/src/split.c b/src/split.c index 01bb75fc..d1317cf9 100644 --- a/src/split.c +++ b/src/split.c @@ -115,7 +115,7 @@ write_split_wim(WIMStruct *orig_wim, const tchar *swm_name, &progress); } - part_write_flags = write_flags & WIMLIB_WRITE_MASK_PUBLIC; + part_write_flags = write_flags; part_write_flags |= WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES; if (part_number != 1) part_write_flags |= WIMLIB_WRITE_FLAG_NO_METADATA; @@ -148,10 +148,12 @@ add_stream_to_swm(struct wim_lookup_table_entry *lte, void *_swm_info) struct swm_info *swm_info = _swm_info; u64 stream_size; - /* We want the compressed size of the stream, but use the uncompressed - * size if the compressed size is not available or not relevant. */ - if (lte->resource_location == RESOURCE_IN_WIM && - (!lte_is_partial(lte) || lte->rspec->size_in_wim < lte->size)) + if (lte_is_partial(lte)) { + ERROR("Splitting of WIM containing packed streams is not supported.\n" + " Export it in the default format first."); + return WIMLIB_ERR_UNSUPPORTED; + } + if (lte->resource_location == RESOURCE_IN_WIM) stream_size = lte->rspec->size_in_wim; else stream_size = lte->size; @@ -209,6 +211,9 @@ wimlib_split(WIMStruct *wim, const tchar *swm_name, if (swm_name == NULL || swm_name[0] == T('\0') || part_size == 0) return WIMLIB_ERR_INVALID_PARAM; + if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC) + return WIMLIB_ERR_INVALID_PARAM; + if (!wim_has_metadata(wim)) return WIMLIB_ERR_METADATA_NOT_FOUND;