summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-10-11 05:48:26 +0300
committerhv <hv@crypt.org>2002-10-17 13:37:04 +0000
commit09448d78b3a7197d822f3a4cddd3020b529656e9 (patch)
treeb73666270035630937d25bb21773c62568065a96 /perl.h
parentd1e2299c1c3e13c365c4beee74f1481ec4de334a (diff)
downloadperl-09448d78b3a7197d822f3a4cddd3020b529656e9.tar.gz
definition of MAXPATHLEN
Subject: [PATCH] standard lawyerism Message-ID: <20021010234825.GM292305@lyta.hut.fi> p4raw-id: //depot/perl@18025
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl.h b/perl.h
index 53919191e2..4f7131311a 100644
--- a/perl.h
+++ b/perl.h
@@ -1972,18 +1972,21 @@ typedef struct clone_params CLONE_PARAMS;
# 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