Fix issue with path striping
This commit is contained in:
parent
4f55e9e9bc
commit
8eda2146d9
|
@ -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 = "";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue