From: Eric Biggers Date: Sun, 19 May 2013 20:06:23 +0000 (-0500) Subject: imagex_update(): Error if no image specified with multi-image WIM X-Git-Tag: v1.4.1~93 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=0e9c01aa6a9fac4060d5a6751f159682681d5486 imagex_update(): Error if no image specified with multi-image WIM --- diff --git a/programs/imagex.c b/programs/imagex.c index 854be037..79eb08db 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -1519,7 +1519,7 @@ imagex_apply(int argc, tchar **argv) num_images = wimlib_get_num_images(w); if (argc == 2 && num_images != 1) { imagex_error(T("\"%"TS"\" contains %d images; Please select one " - "(or all)"), wimfile, num_images); + "(or all)."), wimfile, num_images); usage(APPLY); ret = -1; goto out; @@ -2934,6 +2934,7 @@ imagex_update(int argc, tchar **argv) size_t cmd_file_nchars; struct wimlib_update_command *cmds; size_t num_cmds; + int num_images; const tchar *config_file = NULL; tchar *config_str; @@ -3017,6 +3018,15 @@ imagex_update(int argc, tchar **argv) if (ret) goto out_wimlib_free; + num_images = wimlib_get_num_images(wim); + if (argc == 1 && num_images != 1) { + imagex_error(T("\"%"TS"\" contains %d images; Please select one."), + wimfile, num_images); + usage(UPDATE); + ret = -1; + goto out_wimlib_free; + } + /* Parse capture configuration file if specified */ if (config_file) { size_t config_len;