dirOf: allow use on non-absolute paths
This commit is contained in:
+1
-1
@@ -167,7 +167,7 @@ Path dirOf(const Path & path)
|
||||
{
|
||||
Path::size_type pos = path.rfind('/');
|
||||
if (pos == string::npos)
|
||||
throw Error(format("invalid file name '%1%'") % path);
|
||||
return ".";
|
||||
return pos == 0 ? "/" : Path(path, 0, pos);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user