]> git.tdb.fi Git - libs/core.git/commitdiff
strutils.h -> strings/utils.h
authorMikko Rasa <tdb@tdb.fi>
Wed, 7 Mar 2007 20:18:43 +0000 (20:18 +0000)
committerMikko Rasa <tdb@tdb.fi>
Wed, 7 Mar 2007 20:18:43 +0000 (20:18 +0000)
Small bugfix

Build
source/path.cpp
source/utils.cpp

diff --git a/Build b/Build
index bfd56d3bc0f835ddec0ca0198b55c9dfd29815fb..43bd137c1081202d9270183460e0d00887429065 100644 (file)
--- a/Build
+++ b/Build
@@ -4,6 +4,7 @@ package "msppath"
        description "Filesystem utilities";
 
        require "mspmisc";
        description "Filesystem utilities";
 
        require "mspmisc";
+       require "mspstrings";
 
        library "msppath"
        {
 
        library "msppath"
        {
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
 */
 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"
 
 #include "path.h"
 #include "utils.h"
 
@@ -166,8 +166,10 @@ void Path::add_component(const string &comp)
                                path.erase(slash, string::npos);
                }
        }
                                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;
                if(path.size()>1 || (path.size()==1 && path[0]!=DIRCHAR))
                        path+=DIRCHAR;
                path+=comp;
index 45cd614b150ccaaea463f3c9860dabbe3bc82e1d..5c7d6a230803bcaf47c08b9e43b21aaeb2e55ae6 100644 (file)
@@ -9,7 +9,7 @@ Distributed under the LGPL
 #ifndef WIN32
 #include <fnmatch.h>
 #endif
 #ifndef WIN32
 #include <fnmatch.h>
 #endif
-#include <msp/strutils.h>
+#include <msp/strings/utils.h>
 #include "path.h"
 #include "utils.h"
 
 #include "path.h"
 #include "utils.h"