use skip_prefix to avoid repeating strings
authorJeff King <peff@peff.net>
Wed, 18 Jun 2014 19:48:29 +0000 (15:48 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jun 2014 17:44:45 +0000 (10:44 -0700)
It's a common idiom to match a prefix and then skip past it
with strlen, like:

if (starts_with(foo, "bar"))
foo += strlen("bar");

This avoids magic numbers, but means we have to repeat the
string (and there is no compiler check that we didn't make a
typo in one of the strings).

We can use skip_prefix to handle this case without repeating
ourselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found