Fix issue with path striping

This commit is contained in:
Thomas Avé 2017-01-28 13:51:50 +01:00
parent 4f55e9e9bc
commit 8eda2146d9
1 changed files with 2 additions and 7 deletions

View File

@ -16,7 +16,7 @@
#define fileno(x) _fileno(x)
#define mkdir(x) _mkdir(x)
#include <direct.h>
#define PATHSEP '\\'
#define PATHSEP '/\\'
#else
@ -45,16 +45,11 @@ namespace {
std::size_t pos;
// '/' can be used on most platforms (even windows)
pos = dir.find_last_of('/');
if (pos != dir.npos) {
dir = dir.substr(0,pos + 1);
}
// strip platform specific as well
pos = dir.find_last_of(PATHSEP);
if (pos != dir.npos) {
dir = dir.substr(0,pos + 1);
}
if(dir == filename) {
dir = "";
}