]> sjero.net Git - wget/commitdiff
Fallback to PATH_MAX when pathconf is not available
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 7 Oct 2012 11:06:01 +0000 (13:06 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sun, 7 Oct 2012 11:09:56 +0000 (13:09 +0200)
ChangeLog
configure.ac
src/ChangeLog
src/utils.c

index 2f9498ad9033ad5bc44557c5e337e52dc0901d89..104ca3cbfed18738ed39ccd73da930df16b0ad2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-07  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * configure.ac: Check for patchconf.
+
 2012-09-23  Merinov Nikolay  <kim.roader@gmail.com>
 
        * m4/wget.m4 (WGET_FNMATCH): Add AC_LANG_SOURCE into
index 873c3c926a498f2d4d17f81a044820bdbf9d606d..a413b750f9c5a38d9ffcc671dd75c98df8aabc6f 100644 (file)
@@ -198,7 +198,7 @@ dnl Checks for library functions.
 dnl
 AC_FUNC_MMAP
 AC_FUNC_FSEEKO
-AC_CHECK_FUNCS(strptime timegm vsnprintf vasprintf drand48)
+AC_CHECK_FUNCS(strptime timegm vsnprintf vasprintf drand48 pathconf)
 AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
 AC_CHECK_FUNCS(sleep symlink utime)
 
index 6fd091c25bcfc65bb0196fa921cdc7d66dd48682..13f752964284b183379aa561ac65aa65486a3be1 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-07  Tim Ruehsen  <tim.ruehsen@gmx.de>
+           Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * utils.c (get_max_length): If `pathconf' is not available
+       fallback to PATH_MAX.
+
 2012-10-06  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * http.c (http_loop): Send a HEAD request when -c and
index 729ec50d96275952642c295d01601b5273575de0..faae62e1b334b93422dd0fa2f5fb8f1880b99e79 100644 (file)
@@ -2509,9 +2509,13 @@ get_max_length (const char *path, int length, int name)
     {
       errno = 0;
       /* For an empty path query the current directory. */
+#if HAVE_PATHCONF
       ret = pathconf (*p ? p : ".", name);
       if (!(ret < 0 && errno == ENOENT))
         break;
+#else
+      ret = PATH_MAX;
+#endif
 
       /* The path does not exist yet, but may be created. */
       /* Already at current or root directory, give up. */