X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=36e2f9dda5c85c346e31f45afa6d28b107679970;hb=5e2f779cbf60997809130fde213736e1ea4f6f33;hp=f667368d161609ea3c93fc6ebe2452b9cd0e557d;hpb=1b8dbdb41e503f6829be4e1d8ada4c8eabbc49bd;p=git.git diff --git a/builtin-apply.c b/builtin-apply.c index f667368d1..36e2f9dda 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -823,12 +823,13 @@ static int gitdiff_unrecognized(const char *line, struct patch *patch) static const char *stop_at_slash(const char *line, int llen) { + int nslash = p_value; int i; for (i = 0; i < llen; i++) { int ch = line[i]; - if (ch == '/') - return line + i; + if (ch == '/' && --nslash <= 0) + return &line[i]; } return NULL; }