From 3a69090d70222f5a73aab8db16d3f7d0f282e37a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Nov 2010 23:19:55 +0000 Subject: [PATCH] Don't try to enforce MAXPATHLEN in sys::Path for Unix. OS's can check limits on their own. llvm-svn: 118113 --- lib/System/Unix/Path.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index b7afb8536d5..c90092001e3 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