[llvm-commits] [llvm] r118113 - /llvm/trunk/lib/System/Unix/Path.inc

Dan Gohman gohman at apple.com
Tue Nov 2 16:19:55 PDT 2010


Author: djg
Date: Tue Nov  2 18:19:55 2010
New Revision: 118113

URL: http://llvm.org/viewvc/llvm-project?rev=118113&view=rev
Log:
Don't try to enforce MAXPATHLEN in sys::Path for Unix. OS's can check
limits on their own.

Modified:
    llvm/trunk/lib/System/Unix/Path.inc

Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=118113&r1=118112&r2=118113&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Tue Nov  2 18:19:55 2010
@@ -96,10 +96,12 @@
 
 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





More information about the llvm-commits mailing list