X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.cpp;h=703be2b404744cbe76515ca4ebf40c4226649267;hp=99bcc8bfe216b13101ce51f077ed12d7efd281d4;hb=105d334b3dc59b5d5def485e438d63e203805f2e;hpb=4b326cb4916d981d48a2997df3d82b6b3b7b6b92 diff --git a/source/fs/path.cpp b/source/fs/path.cpp index 99bcc8b..703be2b 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -100,7 +100,7 @@ Path &Path::operator/=(const Path &p) void Path::add_component(const string &comp) { - if(comp.size()==1 && comp[0]==DIRSEP) + if(comp.size()==1 && (comp[0]=='/' || comp[0]=='\\')) { // Replace the path with the root directory #ifdef WIN32 @@ -113,7 +113,7 @@ void Path::add_component(const string &comp) else #endif { - path = comp; + path.assign(1, DIRSEP); separators.clear(); separators.push_back(0); }