From 8caaabbdf4607c60c184bc27469af51cea8ab7b5 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 10 Aug 2010 08:36:31 -0400 Subject: [PATCH] Handle absolute paths passed to Path.fromString --- util/io/Path.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/io/Path.scala b/util/io/Path.scala index d7e494074..bfc7797b3 100644 --- a/util/io/Path.scala +++ b/util/io/Path.scala @@ -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] =