diff options
author | sfan5 <sfan5@live.de> | 2020-06-13 19:03:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 19:03:26 +0200 |
commit | 2424dfe007e451bb02f87884c2b272cf307d6e7c (patch) | |
tree | de43d4ab42126b0533bf5955de3ce68f97f53420 /src/filesys.cpp | |
parent | 982a030f330bd4f4953ed7d4a7f88286f6fd645d (diff) | |
download | minetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.tar.gz minetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.tar.bz2 minetest-2424dfe007e451bb02f87884c2b272cf307d6e7c.zip |
Server pushing media at runtime (#9961)
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r-- | src/filesys.cpp | 6 |
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; } |