X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwrite.c;h=ba8b697078a2efeb2d23a657b10323d05d1cfc25;hb=fced769402ff6ef0bf75fe9e4dcb2880891469e0;hp=90dcaed4201d0d92ce6cf74dfc9691dd4bf11025;hpb=77b2c74599190197074c82937787f24f83ece0af;p=wimlib diff --git a/src/write.c b/src/write.c index 90dcaed4..ba8b6970 100644 --- a/src/write.c +++ b/src/write.c @@ -1547,10 +1547,10 @@ lte_overwrite_prepare_2(struct wim_lookup_table_entry *lte, void *_args) if (lte->resource_entry.offset + lte->resource_entry.size > args->end_offset) { - #ifdef ENABLE_ERROR_MESSAGES - ERROR("The following resource is after the XML data:"); - print_lookup_table_entry(lte, stderr); - #endif + if (wimlib_print_errors) { + ERROR("The following resource is after the XML data:"); + print_lookup_table_entry(lte, stderr); + } return WIMLIB_ERR_RESOURCE_ORDER; } copy_resource_entry(<e->output_resource_entry, @@ -2212,15 +2212,16 @@ wimlib_overwrite(WIMStruct *w, int write_flags, unsigned num_threads, wimlib_progress_func_t progress_func) { + int ret; + write_flags &= WIMLIB_WRITE_MASK_PUBLIC; if (!w->filename) return WIMLIB_ERR_NO_FILENAME; - if (w->hdr.total_parts != 1) { - ERROR("Cannot modify a split WIM"); - return WIMLIB_ERR_SPLIT_UNSUPPORTED; - } + ret = can_modify_wim(w); + if (ret) + return ret; if ((!w->deletion_occurred || (write_flags & WIMLIB_WRITE_FLAG_SOFT_DELETE)) && !(write_flags & WIMLIB_WRITE_FLAG_REBUILD))