Commits

Shlomi Fish  committed 0ff9640

Fix PATH_MAX call on Windows.

  • Participants
  • Parent commits 29bbe8e

Comments (0)

Files changed (2)

File modules/Test-Run/Changes

+0.0302    Sat  1 Feb 10:58:46 IST 2014
+    * Fix PATH_MAX and tests on some ActivePerls in t/output.t.
+        - http://www.cpantesters.org/cpan/report/cfafb504-7709-1014-9112-f72c93e8ee67
+        - Thanks to From: Christian Walde for the CPAN Testers Report.
+
 0.0301    Fri 31 Jan 19:58:27 IST 2014
     * Remove trailing space with a test - t/style-trailing-space.t .
     * Add the README to the distribution.

File modules/Test-Run/t/output.t

 
 sub get_max_system_path_len
 {
-    return List::Util::min(120, POSIX::PATH_MAX());
+    my $MIN_VAL = 120;
+
+    # Some systems don't support PATH_MAX, especially some Windows compilers.
+    # See http://www.cpantesters.org/cpan/report/cfafb504-7709-1014-9112-f72c93e8ee67
+    return List::Util::min(
+        $MIN_VAL,
+        scalar(eval { POSIX::PATH_MAX(); } || $MIN_VAL)
+    );
 }
 
 # Test with an exceptionally long path.