]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.c
The sixth batch for 2.26
[thirdparty/git.git] / parse-options.c
index 60fae3ad213782dffa82e3c7dd246b47c566bf56..a0cef401fcb6d5237aac5eaaefc155054db0f9cf 100644 (file)
@@ -357,8 +357,7 @@ is_abbreviated:
                        }
                        /* negated? */
                        if (!starts_with(arg, "no-")) {
-                               if (starts_with(long_name, "no-")) {
-                                       long_name += 3;
+                               if (skip_prefix(long_name, "no-", &long_name)) {
                                        opt_flags |= OPT_UNSET;
                                        goto again;
                                }
@@ -420,7 +419,7 @@ static void check_typos(const char *arg, const struct option *options)
                return;
 
        if (starts_with(arg, "no-")) {
-               error(_("did you mean `--%s` (with two dashes ?)"), arg);
+               error(_("did you mean `--%s` (with two dashes)?"), arg);
                exit(129);
        }
 
@@ -428,7 +427,7 @@ static void check_typos(const char *arg, const struct option *options)
                if (!options->long_name)
                        continue;
                if (starts_with(options->long_name, arg)) {
-                       error(_("did you mean `--%s` (with two dashes ?)"), arg);
+                       error(_("did you mean `--%s` (with two dashes)?"), arg);
                        exit(129);
                }
        }