diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-15 02:35:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-15 03:04:32 +0300 |
commit | 624b07bf0ee70794240135bb403e9dfb879749c4 (patch) | |
tree | df6ced39a2cdd2f46c7d51747abdee168d29a146 /src/utils/paths.cpp | |
parent | 99bc9d1fb4bccae0785d731711e3b1009de1b394 (diff) | |
download | mv-624b07bf0ee70794240135bb403e9dfb879749c4.tar.gz mv-624b07bf0ee70794240135bb403e9dfb879749c4.tar.bz2 mv-624b07bf0ee70794240135bb403e9dfb879749c4.tar.xz mv-624b07bf0ee70794240135bb403e9dfb879749c4.zip |
Add function to fix dir separator.
Diffstat (limited to 'src/utils/paths.cpp')
-rw-r--r-- | src/utils/paths.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp index faa1882e6..04f553ca9 100644 --- a/src/utils/paths.cpp +++ b/src/utils/paths.cpp @@ -20,10 +20,12 @@ #include "utils/paths.h" +#include "utils/stringutils.h" + #include <string.h> #include <cstdarg> #include <cstdio> - +#include <physfs.h> #include <stdlib.h> #ifdef WIN32 @@ -65,3 +67,11 @@ bool checkPath(std::string path) && path.find("/..") == std::string::npos && path.find("\\..") == std::string::npos; } + +std::string &fixDirSeparators(std::string &str) +{ + if (*PHYSFS_getDirSeparator() == '/') + return str; + + return replaceAll(str, "/", "\\"); +} |