diff options
author | Miles Sabin <miles@milessabin.com> | 2009-11-16 10:17:01 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-11-16 10:17:01 +0000 |
commit | ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d (patch) | |
tree | 96ae34144ad6c8fc1ed08aaa8bb301f9c00a7f60 | |
parent | 540aa394f36ed423443058dcb108db3800e0bf1a (diff) | |
download | scala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.tar.gz scala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.tar.bz2 scala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.zip |
Fixed #2627.
-rw-r--r-- | src/compiler/scala/tools/nsc/io/Path.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/io/Path.scala b/src/compiler/scala/tools/nsc/io/Path.scala index e7a6fddba4..8e4c58a35e 100644 --- a/src/compiler/scala/tools/nsc/io/Path.scala +++ b/src/compiler/scala/tools/nsc/io/Path.scala @@ -93,7 +93,7 @@ class Path private[io] (val jfile: JFile) def path: String = jfile.getPath() def normalize: Path = Path(jfile.getCanonicalPath()) - def resolve(other: Path) = if (other.isAbsolute) other else /(other) + def resolve(other: Path) = if (other.isAbsolute || isEmpty) other else /(other) def relativize(other: Path) = { assert(isAbsolute == other.isAbsolute, "Paths not of same type: "+this+", "+other) @@ -135,6 +135,7 @@ class Path private[io] (val jfile: JFile) val x = parent.get / name x.normalize != x.toAbsolute } + def isEmpty = path.length == 0 // Information def lastModified = jfile.lastModified() |