X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fgetcwd.m4;h=269fdd7c653e8da0752b6cceff34194aae6bca16;hb=d5df3358bd3ae257b342d03796dbd02e24638cf2;hp=55f937222bc2549da5491ff556c53bd1e7564f16;hpb=043be67acb94a724f96e3b18c3a09aefffd463af;p=gnulib.git diff --git a/m4/getcwd.m4 b/m4/getcwd.m4 index 55f937222..269fdd7c6 100644 --- a/m4/getcwd.m4 +++ b/m4/getcwd.m4 @@ -6,7 +6,7 @@ # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 5 +# serial 7 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ @@ -20,7 +20,8 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], # endif ]], [[ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* mingw cwd does not start with '/', but getcwd does allocate. */ +/* mingw cwd does not start with '/', but getcwd does allocate. + However, mingw fails to honor non-zero size. */ #else if (chdir ("/") != 0) return 1; @@ -36,6 +37,9 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], return 0; } #endif + /* If size is non-zero, allocation must fail if size is too small */ + if (getcwd (NULL, 1)) + return 5; ]])], [gl_cv_func_getcwd_null=yes], [gl_cv_func_getcwd_null=no], @@ -45,8 +49,6 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], *-gnu*) gl_cv_func_getcwd_null="guessing yes";; # Guess yes on Cygwin. cygwin*) gl_cv_func_getcwd_null="guessing yes";; - # Guess yes on mingw. - mingw*) gl_cv_func_getcwd_null="guessing yes";; # If we don't know, assume the worst. *) gl_cv_func_getcwd_null="guessing no";; esac @@ -69,9 +71,8 @@ AC_DEFUN([gl_FUNC_GETCWD_LGPL], case $gl_cv_func_getcwd_null in *yes) ;; *) - dnl Minimal replacement + dnl Minimal replacement lib/getcwd-lgpl.c. REPLACE_GETCWD=1 - AC_LIBOBJ([getcwd-lgpl]) ;; esac ]) @@ -96,10 +97,8 @@ AC_DEFUN([gl_FUNC_GETCWD], case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in *yes,yes,no) ;; *) - dnl Full replacement, overrides LGPL replacement. - REPLACE_GETCWD=1 - AC_LIBOBJ([getcwd]) - gl_PREREQ_GETCWD;; + dnl Full replacement lib/getcwd.c, overrides LGPL replacement. + REPLACE_GETCWD=1;; esac ])