Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r--parse-options-cb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c
index 2733393546..02293493b0 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -16,6 +16,9 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset)
if (!arg) {
v = unset ? 0 : DEFAULT_ABBREV;
} else {
+ if (!*arg)
+ return error(_("option `%s' expects a numerical value"),
+ opt->long_name);
v = strtol(arg, (char **)&arg, 10);
if (*arg)
return error(_("option `%s' expects a numerical value"),