diff options
-rw-r--r-- | editors/patch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/editors/patch.c b/editors/patch.c index 65b8f659b..3de293f03 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -58,6 +58,13 @@ static char *extract_filename(char *line, int patch_level) | |||
58 | temp = strchr(filename_start_ptr, '\t'); | 58 | temp = strchr(filename_start_ptr, '\t'); |
59 | if (temp) *temp = 0; | 59 | if (temp) *temp = 0; |
60 | 60 | ||
61 | if (patch_level == -1) { | ||
62 | temp = strrchr(filename_start_ptr, '/'); | ||
63 | if (temp) | ||
64 | filename_start_ptr = temp + 1; | ||
65 | return xstrdup(filename_start_ptr); | ||
66 | } | ||
67 | |||
61 | /* skip over (patch_level) number of leading directories */ | 68 | /* skip over (patch_level) number of leading directories */ |
62 | for (i = 0; i < patch_level; i++) { | 69 | for (i = 0; i < patch_level; i++) { |
63 | temp = strchr(filename_start_ptr, '/'); | 70 | temp = strchr(filename_start_ptr, '/'); |