diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-15 04:17:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-15 04:17:07 +0000 |
commit | 3f556daa6e5af0b0cff7bb6446ccf4836ce8e14e (patch) | |
tree | 6495b5735a50f30e39770cf6c4eea02e951fee49 /llvm/lib/System/Unix/Path.inc | |
parent | a5e67757dce04509a201d0a2330ac8e8132681d3 (diff) | |
download | bcm5719-llvm-3f556daa6e5af0b0cff7bb6446ccf4836ce8e14e.tar.gz bcm5719-llvm-3f556daa6e5af0b0cff7bb6446ccf4836ce8e14e.zip |
add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!
llvm-svn: 73368
Diffstat (limited to 'llvm/lib/System/Unix/Path.inc')
-rw-r--r-- | llvm/lib/System/Unix/Path.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index d5edee1b03b..1f73571cf14 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/lib/System/Unix/Path.inc @@ -104,6 +104,14 @@ Path::isValid() const { } bool +Path::isAbsolute(const char *NameStart, unsigned NameLen) { + assert(NameStart); + if (NameLen == 0) + return false; + return NameStart[0] == '/'; +} + +bool Path::isAbsolute() const { if (path.empty()) return false; |