Code

difftool--helper: Update copyright and remove distracting comments
[git.git] / builtin-apply.c
index f667368d161609ea3c93fc6ebe2452b9cd0e557d..36e2f9dda5c85c346e31f45afa6d28b107679970 100644 (file)
@@ -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;
 }