AIX 7.1 realpath() gets horribly confused by consecutive /
in the name to be resolved.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Expose AIX bug.
* doc/posix-functions/realpath.texi (realpath): Document it.
Reported by Bruno Haible.
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit
c2245238b3d9cc9a367c133065ef675e2f599333)
+2011-06-06 Eric Blake <eblake@redhat.com>
+
+ canonicalize-lgpl: work around AIX realpath bug
+ * m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Expose AIX bug.
+ * doc/posix-functions/realpath.texi (realpath): Document it.
+ Reported by Bruno Haible.
+
2011-06-06 Bruno Haible <bruno@clisp.org>
careadlinkat: Avoid mismatch between ssize_t and int.
2011-06-06 Bruno Haible <bruno@clisp.org>
careadlinkat: Avoid mismatch between ssize_t and int.
This function fails to recognize non-directories followed @samp{..} on
some platforms:
cygwin.
This function fails to recognize non-directories followed @samp{..} on
some platforms:
cygwin.
+@item
+This function misbehaves on consecutive slashes on some platforms:
+AIX 7.
@end itemize
Portability problems not fixed by Gnulib:
@end itemize
Portability problems not fixed by Gnulib:
-# canonicalize.m4 serial 19
+# canonicalize.m4 serial 20
dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
AC_CHECK_FUNCS_ONCE([realpath])
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
touch conftest.a
AC_CHECK_FUNCS_ONCE([realpath])
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
touch conftest.a
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
]GL_NOCRASH[
#include <stdlib.h>
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
]GL_NOCRASH[
#include <stdlib.h>
if (name != NULL)
result |= 4;
}
if (name != NULL)
result |= 4;
}
+ {
+ char *name1 = realpath (".", NULL);
+ char *name2 = realpath ("conftest.d//./..", NULL);
+ if (strcmp (name1, name2) != 0)
+ result |= 8;
+ }
return result;
]])
], [gl_cv_func_realpath_works=yes], [gl_cv_func_realpath_works=no],
[gl_cv_func_realpath_works="guessing no"])
return result;
]])
], [gl_cv_func_realpath_works=yes], [gl_cv_func_realpath_works=no],
[gl_cv_func_realpath_works="guessing no"])
+ rm -Rf conftest.a conftest.d
])
if test "$gl_cv_func_realpath_works" = yes; then
AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
])
if test "$gl_cv_func_realpath_works" = yes; then
AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()