Change 18025 by [EMAIL PROTECTED] on 2002/10/17 13:37:04
definition of MAXPATHLEN
Subject: [PATCH] standard lawyerism
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Fri, 11 Oct 2002 02:48:26 +0300
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
.... //depot/perl/perl.h#477 edit
Differences ...
==== //depot/perl/perl.h#477 (text) ====
Index: perl/perl.h
--- perl/perl.h#476~17953~ Wed Oct 2 05:55:29 2002
+++ perl/perl.h Thu Oct 17 06:37:04 2002
@@ -1972,18 +1972,21 @@
# ifdef PATH_MAX
# ifdef _POSIX_PATH_MAX
# if PATH_MAX > _POSIX_PATH_MAX
-/* MAXPATHLEN is supposed to include the final null character,
- * as opposed to PATH_MAX and _POSIX_PATH_MAX. */
-# define MAXPATHLEN (PATH_MAX+1)
+/* POSIX 1990 (and pre) was ambiguous about whether PATH_MAX
+ * included the null byte or not. Later amendments of POSIX,
+ * XPG4, the Austin Group, and the Single UNIX Specification
+ * all explicitly include the null byte in the PATH_MAX.
+ * Ditto for _POSIX_PATH_MAX. */
+# define MAXPATHLEN PATH_MAX
# else
-# define MAXPATHLEN (_POSIX_PATH_MAX+1)
+# define MAXPATHLEN _POSIX_PATH_MAX
# endif
# else
# define MAXPATHLEN (PATH_MAX+1)
# endif
# else
# ifdef _POSIX_PATH_MAX
-# define MAXPATHLEN (_POSIX_PATH_MAX+1)
+# define MAXPATHLEN _POSIX_PATH_MAX
# else
# define MAXPATHLEN 1024 /* Err on the large side. */
# endif
End of Patch.