From: Mikko Rasa Date: Wed, 7 Mar 2007 20:18:43 +0000 (+0000) Subject: strutils.h -> strings/utils.h X-Git-Tag: fs-1.0~15 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=174debf33b2001b3244c007825d0a5539566bd8c;p=libs%2Fcore.git strutils.h -> strings/utils.h Small bugfix --- diff --git a/Build b/Build index bfd56d3..43bd137 100644 --- a/Build +++ b/Build @@ -4,6 +4,7 @@ package "msppath" description "Filesystem utilities"; require "mspmisc"; + require "mspstrings"; library "msppath" { diff --git a/source/path.cpp b/source/path.cpp index e79a8fe..4f3a0b1 100644 --- a/source/path.cpp +++ b/source/path.cpp @@ -3,7 +3,7 @@ This file is part of libmsppath Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include +#include #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; diff --git a/source/utils.cpp b/source/utils.cpp index 45cd614..5c7d6a2 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -9,7 +9,7 @@ Distributed under the LGPL #ifndef WIN32 #include #endif -#include +#include #include "path.h" #include "utils.h"