summaryrefslogtreecommitdiff
path: root/lib/System
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-02 23:19:55 +0000
committerDan Gohman <gohman@apple.com>2010-11-02 23:19:55 +0000
commitac793822cd27554c6409b5c380555f94be48b431 (patch)
tree9a1d077dc99e50e0c4941d01132badc11cfb88ea /lib/System
parentd51257a4368d52e2340073bc7ccd83f3c3f1c04d (diff)
downloadllvm-ac793822cd27554c6409b5c380555f94be48b431.tar.gz
llvm-ac793822cd27554c6409b5c380555f94be48b431.tar.bz2
llvm-ac793822cd27554c6409b5c380555f94be48b431.tar.xz
Don't try to enforce MAXPATHLEN in sys::Path for Unix. OS's can check
limits on their own. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/Path.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index b7afb8536d..c90092001e 100644
--- a/lib/System/Unix/Path.inc
+++ b/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