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 | 88d7e403d02ad9ef72972b22c0fd2975d5a38bfd (patch) | |
tree | d5366ad1caad8d15bb8d2d844f4ec074ed33b6d2 /lib/System/Unix/Path.inc | |
parent | e4935150c71170ee0aa174e08282a6913148c04c (diff) |
add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/Path.inc')
-rw-r--r-- | lib/System/Unix/Path.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index d5edee1b03..1f73571cf1 100644 --- a/lib/System/Unix/Path.inc +++ b/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; |