summaryrefslogtreecommitdiff
path: root/lib/canonicalize.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-08-05 03:01:01 +0200
committerBruno Haible <bruno@clisp.org>2011-08-05 03:01:01 +0200
commit6310fc6d3e3f086e825cbd6f53950fbdc1ac7b42 (patch)
tree051f5bba7dc9b6acc19e8e2507ab3a091054a618 /lib/canonicalize.c
parent7f494c7d725db4a7f3abdef09d4070725487da67 (diff)
downloadgnulib-6310fc6d3e3f086e825cbd6f53950fbdc1ac7b42.tar.gz
pathmax: Leave PATH_MAX undefined on the Hurd, and a constant otherwise.
* lib/pathmax.h (PATH_MAX): Leave it undefined on GNU/Hurd. * lib/chdir-long.h: Include pathmax.h. * lib/clean-temp.c (PATH_MAX): Remove code that is done by pathmax.h. * lib/getcwd.c: Include pathmax.h instead of <limits.h>. (PATH_MAX): Remove code that is done by pathmax.h. * lib/canonicalize.c (PATH_MAX): Provide a fallback value. * lib/tmpfile.c: Add a comment. * m4/pathmax.m4 (gl_PATHMAX): Don't test for pathconf. * modules/chdir-long (Depends-on): Add pathmax. * modules/getcwd (Depends-on): Add pathmax. * tests/test-getcwd.c (test_abort_bug): Avoid syntax error when PATH_MAX is not defined. * doc/posix-headers/limits.texi: Mention the pathmax module. * NEWS: Mention the change.
Diffstat (limited to 'lib/canonicalize.c')
-rw-r--r--lib/canonicalize.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/canonicalize.c b/lib/canonicalize.c
index a329a33519..4fe9f308af 100644
--- a/lib/canonicalize.c
+++ b/lib/canonicalize.c
@@ -31,6 +31,12 @@
#include "xalloc.h"
#include "xgetcwd.h"
+/* In this file, we cannot handle file names longer than PATH_MAX.
+ On systems with no file name length limit, use a fallback. */
+#ifndef PATH_MAX
+# define PATH_MAX 8192
+#endif
+
#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
#endif