X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.cpp;h=f12e27492709423f0875ecb046b0f6b2724dfd03;hp=c56505e907eb3fd9ce756f430f23e6f22aed7bd1;hb=601e088dc38005e4346766a09129a80e81c637f3;hpb=fbc986fca28ce01240718a7835ee7e4798b5d20d;ds=sidebyside diff --git a/source/fs/path.cpp b/source/fs/path.cpp index c56505e..f12e274 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -7,8 +7,10 @@ using namespace std; namespace { +#ifdef WIN32 inline bool is_windows_drive(const std::string &p) { return (p.size()==2 && ((p[0]>='A' && p[0]<='Z') || (p[0]>='a' && p[0]<='z')) && p[1]==':'); } +#endif } @@ -63,9 +65,7 @@ bool Path::is_absolute() const if(is_windows_drive((*this)[0])) return true; #endif - if(path[0]==DIRSEP) - return true; - return false; + return path[0]==DIRSEP; } Path Path::subpath(unsigned start, unsigned count) const