X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Fgetcwd.m4;fp=m4%2Fgetcwd.m4;h=566c3c13ea8274356a4f265542ef93ae467a6cab;hb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;hp=6f91bd99e5f45a425697903911512bc144781151;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip diff --git a/m4/getcwd.m4 b/m4/getcwd.m4 index 6f91bd9..566c3c1 100644 --- a/m4/getcwd.m4 +++ b/m4/getcwd.m4 @@ -1,12 +1,12 @@ # getcwd.m4 - check for working getcwd that is compatible with glibc -# Copyright (C) 2001, 2003-2007, 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 12 +# serial 13 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ @@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], [gl_cv_func_getcwd_null], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +# include # if HAVE_UNISTD_H # include # else /* on Windows with MSVC */ @@ -39,6 +40,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], return 3; if (f[1] != '\0') return 4; + free (f); return 0; } #endif @@ -136,11 +138,16 @@ AC_DEFUN([gl_FUNC_GETCWD], [Define to 1 if getcwd works, except it sometimes fails when it shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.]) ;; + "yes, but with shorter paths") + AC_DEFINE([HAVE_GETCWD_SHORTER], [1], + [Define to 1 if getcwd works, but with shorter paths + than is generally tested with the replacement.]) + ;; esac if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ || test $gl_cv_func_getcwd_posix_signature != yes \ - || test "$gl_cv_func_getcwd_path_max" != yes \ + || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ || test $gl_abort_bug = yes; then REPLACE_GETCWD=1 fi