aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2007-03-29 17:27:38 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2007-03-29 17:27:38 +0000
commit84892be310e1c578f0cf093e51dd4c9c5d14ac84 (patch)
tree584064ef5d9eeaae8e5e4fd133c9b83246e85176 /lib/System/Win32
parent4031befb62d90309bdaa3c9cbed9c0b5fc12d67c (diff)
downloadexternal_llvm-84892be310e1c578f0cf093e51dd4c9c5d14ac84.zip
external_llvm-84892be310e1c578f0cf093e51dd4c9c5d14ac84.tar.gz
external_llvm-84892be310e1c578f0cf093e51dd4c9c5d14ac84.tar.bz2
Determine absolute paths the correct way :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Path.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index f5edaa0..5bb2e39 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -107,9 +107,15 @@ Path::isValid() const {
bool
Path::isAbsolute() const {
- if (path.length() < 3)
- return false;
- return path[0] == 'C' && path[1] == ':' && path[2] == '\\';
+ switch (path.length()) {
+ case 0:
+ return false;
+ case 1:
+ case 2:
+ return path[0] == '/';
+ default:
+ return path[0] == '/' || (path[1] == ':' && path[2] == '/');
+ }
}
static Path *TempDirectory = NULL;