diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-05-30 19:50:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-30 19:50:44 +0200 |
commit | 20aa7c594fbc2e36476daae2f53d7c020306c62c (patch) | |
tree | 16594455c941e4bc0002e32a624d27a29b0caeed /parse-options.c | |
parent | Git 2.22-rc1 (diff) | |
parent | parse-options: check empty value in OPT_INTEGER and OPT_ABBREV (diff) | |
download | git-20aa7c594fbc2e36476daae2f53d7c020306c62c.tar.xz git-20aa7c594fbc2e36476daae2f53d7c020306c62c.zip |
Merge branch 'nd/diff-parseopt'
A brown-paper-bag bugfix to a change already in 'master'.
* nd/diff-parseopt:
parse-options: check empty value in OPT_INTEGER and OPT_ABBREV
diff-parseopt: restore -U (no argument) behavior
diff-parseopt: correct variable types that are used by parseopt
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c index 987e27cb91..87b26a1d92 100644 --- a/parse-options.c +++ b/parse-options.c @@ -195,6 +195,9 @@ static enum parse_opt_result get_value(struct parse_opt_ctx_t *p, } if (get_arg(p, opt, flags, &arg)) return -1; + if (!*arg) + return error(_("%s expects a numerical value"), + optname(opt, flags)); *(int *)opt->value = strtol(arg, (char **)&s, 10); if (*s) return error(_("%s expects a numerical value"), |