[llvm-commits] CVS: llvm/lib/System/Win32/Path.inc

Jeff Cohen jeffc at jolt-lang.org
Thu Mar 29 10:27:55 PDT 2007



Changes in directory llvm/lib/System/Win32:

Path.inc updated: 1.61 -> 1.62
---
Log message:

Determine absolute paths the correct way :)

---
Diffs of the changes:  (+9 -3)

 Path.inc |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


Index: llvm/lib/System/Win32/Path.inc
diff -u llvm/lib/System/Win32/Path.inc:1.61 llvm/lib/System/Win32/Path.inc:1.62
--- llvm/lib/System/Win32/Path.inc:1.61	Thu Mar 29 12:00:31 2007
+++ llvm/lib/System/Win32/Path.inc	Thu Mar 29 12:27:38 2007
@@ -107,9 +107,15 @@
 
 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;






More information about the llvm-commits mailing list