From 60c552246754d9c241f30111be0b68b295dcf9b5 Mon Sep 17 00:00:00 2001 From: Jeff Cohen Date: Thu, 29 Mar 2007 17:27:38 +0000 Subject: Determine absolute paths the correct way :) llvm-svn: 35464 --- llvm/lib/System/Win32/Path.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'llvm/lib/System') 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; -- cgit v1.2.3