]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.cpp
Fix compile errors on 64-bit systems
[libs/core.git] / source / utils.cpp
index a0c2486f17402593b2e48199fc9d689923098809..22fe1acab7f1a2bd2293204cbcd0d70152366c77 100644 (file)
@@ -30,6 +30,12 @@ string basename(const Path &p)
 
 Path dirname(const Path &p)
 {
 
 Path dirname(const Path &p)
 {
+       if(p.size()==1)
+       {
+               if(p.is_absolute())
+                       return p;
+               return ".";
+       }
        return p.subpath(0, p.size()-1);
 }
 
        return p.subpath(0, p.size()-1);
 }
 
@@ -41,7 +47,7 @@ string basepart(const string &fn)
 
 string extpart(const string &fn)
 {
 
 string extpart(const string &fn)
 {
-       unsigned dot=fn.rfind('.');
+       string::size_type dot=fn.rfind('.');
        if(dot==string::npos)
                return string();
        return fn.substr(dot);
        if(dot==string::npos)
                return string();
        return fn.substr(dot);
@@ -82,6 +88,7 @@ Path fix_case(const Path &path)
 Path readlink(const Path &link)
 {
 #ifdef WIN32
 Path readlink(const Path &link)
 {
 #ifdef WIN32
+       (void)link;
        throw Exception("No symbolic links on win32");
 #else
        char buf[4096];
        throw Exception("No symbolic links on win32");
 #else
        char buf[4096];