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 3630df46b..4a4a2e418 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -662,6 +662,12 @@ std::string RemoveRelativePathComponents(std::string path)
return path.substr(0, pos);
}
+const char *GetFilenameFromPath(const char *path)
+{
+ const char *filename = strrchr(path, DIR_DELIM_CHAR);
+ return filename ? filename + 1 : path;
+}
+
bool safeWriteToFile(const std::string &path, const std::string &content)
{
std::string tmp_file = path + ".~mt";