summaryrefslogtreecommitdiff
path: root/src/filesys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r--src/filesys.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/filesys.cpp b/src/filesys.cpp
index f61b39b94..0bc351669 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -691,6 +691,12 @@ std::string AbsolutePath(const std::string &path)
const char *GetFilenameFromPath(const char *path)
{
const char *filename = strrchr(path, DIR_DELIM_CHAR);
+ // Consistent with IsDirDelimiter this function handles '/' too
+ if (DIR_DELIM_CHAR != '/') {
+ const char *tmp = strrchr(path, '/');
+ if (tmp && tmp > filename)
+ filename = tmp;
+ }
return filename ? filename + 1 : path;
}