Handle absolute paths passed to Path.fromString

This commit is contained in:
Mark Harrah 2010-08-10 08:36:31 -04:00
parent d3f02f7c80
commit 8caaabbdf4
1 changed files with 8 additions and 2 deletions

View File

@ -193,8 +193,14 @@ object Path extends Alternatives with Mapper
basePath
else
{
val components = value.split("""[/\\]""")
(basePath /: components)( (path, component) => path / component )
val f = new File(value)
if(f.isAbsolute)
fromFile(f)
else
{
val components = value.split("""[/\\]""")
(basePath /: components)( (path, component) => path / component )
}
}
}
def baseAncestor(path: Path): Option[Path] =