summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
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
commit60c552246754d9c241f30111be0b68b295dcf9b5 (patch)
treebf410caf7067dd0066f942105d80442670954367 /llvm/lib/System
parentd394617a55809ecd30dcd0f67589484907a1a5e2 (diff)
downloadbcm5719-llvm-60c552246754d9c241f30111be0b68b295dcf9b5.tar.gz
bcm5719-llvm-60c552246754d9c241f30111be0b68b295dcf9b5.zip
Determine absolute paths the correct way :)
llvm-svn: 35464
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Win32/Path.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc
index f5edaa07edb..5bb2e39e949 100644
--- a/llvm/lib/System/Win32/Path.inc
+++ b/llvm/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;
OpenPOWER on IntegriCloud