diff options
author | Dan Gohman <gohman@apple.com> | 2010-11-02 23:19:55 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-11-02 23:19:55 +0000 |
commit | c0a8bee4b02f5b54ceff2b90950659a66d195697 (patch) | |
tree | 58445044e0fe7ed9662459546414930de1637ed4 /llvm/lib/System/Unix | |
parent | 4d23eb2f0e5b6b8f5551d12febe88a38fb67eae1 (diff) | |
download | bcm5719-llvm-c0a8bee4b02f5b54ceff2b90950659a66d195697.tar.gz bcm5719-llvm-c0a8bee4b02f5b54ceff2b90950659a66d195697.zip |
Don't try to enforce MAXPATHLEN in sys::Path for Unix. OS's can check
limits on their own.
llvm-svn: 118113
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r-- | llvm/lib/System/Unix/Path.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index b7afb8536d5..c90092001e3 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/lib/System/Unix/Path.inc @@ -96,10 +96,12 @@ Path::operator=(StringRef that) { bool Path::isValid() const { - // Check some obvious things - if (path.empty()) - return false; - return path.length() < MAXPATHLEN; + // Empty paths are considered invalid here. + // This code doesn't check MAXPATHLEN because there's no need. Nothing in + // LLVM manipulates Paths with fixed-sizes arrays, and if the OS can't + // handle names longer than some limit, it'll report this on demand using + // ENAMETOLONG. + return !path.empty(); } bool |