X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.cpp;h=1a9460ac9c15f4496fd320adacf89d9aed36401a;hp=b6942149b927cf3befc95d2b9b5cb674a33d6b3f;hb=4cc2d6ced17e8cbe1ae3251069131d22a292b857;hpb=6f4ac56492d45c04df0f205252b3c3210e319b4f diff --git a/source/path.cpp b/source/path.cpp index b694214..1a9460a 100644 --- a/source/path.cpp +++ b/source/path.cpp @@ -4,7 +4,6 @@ Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #include -#include "utils.h" #include "path.h" #include "utils.h" @@ -142,10 +141,12 @@ Path::iterator::iterator(const Path &p): path(p), start(0) { - if(path.path[0]==DIRCHAR) + if(path.path.empty()) + start=end=string::npos; + else if(path.path[0]==DIRCHAR) end=1; #ifdef WIN32 - else if(path.path[2]==DIRCHAR && is_windows_drive(path.path.substr(0,2))) + else if(path.path.size()>2 && path.path[2]==DIRCHAR && is_windows_drive(path.path.substr(0,2))) end=2; #endif else