]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options-cb.c
grep tests: move binary pattern tests into their own file
[thirdparty/git.git] / parse-options-cb.c
index 4b95d04a37c028322c6fbf7d3f1b59e0d541fdb3..a3de795c581a3aab084efac75ed2d6edc2535a15 100644 (file)
@@ -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"),