From 7220ca906dfc804bd508336f5bed252bcec62ae0 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 26 Apr 2015 01:24:19 -0400 Subject: Tests: Modularize unit testing Split unit tests into separate files under src/unittest/ Give better unittest diagnostics Clean up some code --- src/filesys.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/filesys.cpp') 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"; -- cgit v1.2.3