Skip to content

Commit ec6ee0c

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e412e8 commit ec6ee0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ static int do_generic_cmd(const char *me, char *arg)
1616
setup_path();
1717
if (!arg || !(arg = sq_dequote(arg)) || *arg == '-')
1818
die("bad argument");
19-
if (!starts_with(me, "git-"))
19+
if (!skip_prefix(me, "git-", &me))
2020
die("bad command");
2121

22-
my_argv[0] = me + 4;
22+
my_argv[0] = me;
2323
my_argv[1] = arg;
2424
my_argv[2] = NULL;
2525

0 commit comments

Comments
 (0)