]> git.tdb.fi Git - libs/core.git/blobdiff - source/path.cpp
strutils.h -> strings/utils.h
[libs/core.git] / source / path.cpp
index e79a8fe010210e18da9c57817d35754292d61e70..4f3a0b1547c3ea94018feac0c4bbd3bbbbfe77eb 100644 (file)
@@ -3,7 +3,7 @@ This file is part of libmsppath
 Copyright © 2006  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
-#include <msp/strutils.h>
+#include <msp/strings/utils.h>
 #include "path.h"
 #include "utils.h"
 
@@ -166,8 +166,10 @@ void Path::add_component(const string &comp)
                                path.erase(slash, string::npos);
                }
        }
-       else if(comp!=".")
+       else if(comp!="." || path.empty())
        {
+               if(path==".")
+                       path="";
                if(path.size()>1 || (path.size()==1 && path[0]!=DIRCHAR))
                        path+=DIRCHAR;
                path+=comp;