aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8572328cd..95b47ea3a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4368,6 +4368,18 @@ parse_filename(char *ptr, size_t len)
}
}
+ /* If the filename contains a backslash, only use filename portion. The idea
+ is that even systems that don't handle backslashes as path separators
+ probably want the path removed for convenience. */
+ q = strrchr(p, '\\');
+ if (q) {
+ p = q+1;
+ if (!*p) {
+ free(copy);
+ return NULL;
+ }
+ }
+
if(quote) {
/* if the file name started with a quote, then scan for the end quote and
stop there */