]> git.ipfire.org Git - thirdparty/git.git/blobdiff - alias.c
use skip_prefix to avoid magic numbers
[thirdparty/git.git] / alias.c
diff --git a/alias.c b/alias.c
index 5efc3d69866731d0f56464c522b00f253f84c187..758c8671494ad003a6e7e33f8a14b5450311bf54 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -5,7 +5,8 @@ static char *alias_val;
 
 static int alias_lookup_cb(const char *k, const char *v, void *cb)
 {
-       if (starts_with(k, "alias.") && !strcmp(k + 6, alias_key)) {
+       const char *name;
+       if (skip_prefix(k, "alias.", &name) && !strcmp(name, alias_key)) {
                if (!v)
                        return config_error_nonbool(k);
                alias_val = xstrdup(v);