- if(start>=path->path.size())
- return string();
- if(start==end)
- return string();
- return path->path.substr(start, end-start);
+ if(end)
+ {
+ current.clear();
+ return;
+ }
+
+ string::size_type start = 0;
+ if(iter!=path->separators.begin())
+ {
+ PositionArray::const_iterator prev = iter;
+ start = *--prev+1;
+ }
+
+ string::size_type slash = string::npos;
+ if(iter!=path->separators.end())
+ slash = *iter;
+
+ if(slash==0)
+ current = path->path.substr(start, 1);
+ else
+ current = path->path.substr(start, slash-start);