shell: use skip_prefix() instead of starts_with()
Get rid of a magic number by using skip_prefix() instead of starts_with(). Signed-off-by: René Scharfe <l.s.r@web.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Nov 26, 2019 at 16:00 UTC
ec6ee0c07a6dc93dd18003b069c78f514ccbe427
1 file changed
+2
-2
shell.c
+2
-2
@@ -16,10 +16,10 @@ static int do_generic_cmd(const char *me, char *arg)
16
setup_path();
17
if (!arg || !(arg = sq_dequote(arg)) || *arg == '-')
18
die("bad argument");
19
- if (!starts_with(me, "git-"))
19
+ if (!skip_prefix(me, "git-", &me))
20
die("bad command");
21
22
- my_argv[0] = me + 4;
22
+ my_argv[0] = me;
23
my_argv[1] = arg;
24
my_argv[2] = NULL;
25