X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.cpp;h=4f3a0b1547c3ea94018feac0c4bbd3bbbbfe77eb;hp=e79a8fe010210e18da9c57817d35754292d61e70;hb=174debf33b2001b3244c007825d0a5539566bd8c;hpb=da904316fb2ed4e2d084726e20f514f6faf956f7 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;