X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.cpp;h=703be2b404744cbe76515ca4ebf40c4226649267;hp=241b2f8aeb938493f006d735f36a9f8f4c41e6ec;hb=105d334b3dc59b5d5def485e438d63e203805f2e;hpb=a0d162e53034a6ef2ef8cfc310a3ee18a6a3872e diff --git a/source/fs/path.cpp b/source/fs/path.cpp index 241b2f8..703be2b 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -89,7 +89,7 @@ Path Path::operator/(const Path &p) const Path &Path::operator/=(const Path &p) { if(p.is_absolute()) - path = p.path; + *this = p; else { for(Iterator i=p.begin(); i!=p.end(); ++i) @@ -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); }