summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/io/Path.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-11-16 10:17:01 +0000
committerMiles Sabin <miles@milessabin.com>2009-11-16 10:17:01 +0000
commited4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d (patch)
tree96ae34144ad6c8fc1ed08aaa8bb301f9c00a7f60 /src/compiler/scala/tools/nsc/io/Path.scala
parent540aa394f36ed423443058dcb108db3800e0bf1a (diff)
downloadscala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.tar.gz
scala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.tar.bz2
scala-ed4caf3fe83c9dcb67d9fcd9d97cf4ebd8960e7d.zip
Fixed #2627.
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/Path.scala')
-rw-r--r--src/compiler/scala/tools/nsc/io/Path.scala3
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()