mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-17 00:50:58 +00:00
Determine absolute paths the correct way :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4031befb62
commit
84892be310
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user