From f3e4befcd28d79d1186083f4ec5513dfd5b0f395 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 18 Dec 2006 18:04:20 +0000 Subject: [PATCH] * lib/dirname.h (DOUBLE_SLASH_IS_DISTINCT_ROOT): Default to 0, not 1. This is more consistent with the other defines here. * m4/double-slash-root.m4 (gl_DOUBLE_SLASH_ROOT): Port to z/OS. Problem reported by Paul Gilmartin. Change local vars to use gl_ prefix rather than ac_. Don't define DOUBLE_SLASH_IS_DISTINCT_ROOT to 0, for consistency with other defines. * modules/double-slash-root: New module. * modules/dirname (Files): Remove m4/double-slash-root.m4. (Depends-on): Add double-slash-root. * MODULES.html.sh (File system functions): Mention new module. --- ChangeLog | 15 +++++++++++++++ MODULES.html.sh | 1 + lib/dirname.h | 2 +- m4/double-slash-root.m4 | 33 ++++++++++++++------------------- modules/dirname | 4 ++-- modules/double-slash-root | 20 ++++++++++++++++++++ 6 files changed, 53 insertions(+), 22 deletions(-) create mode 100644 modules/double-slash-root diff --git a/ChangeLog b/ChangeLog index 02b9a1ef2..fe3b8add8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-12-18 Paul Eggert + and Eric Blake + + * lib/dirname.h (DOUBLE_SLASH_IS_DISTINCT_ROOT): Default to 0, not 1. + This is more consistent with the other defines here. + * m4/double-slash-root.m4 (gl_DOUBLE_SLASH_ROOT): + Port to z/OS. Problem reported by Paul Gilmartin. + Change local vars to use gl_ prefix rather than ac_. + Don't define DOUBLE_SLASH_IS_DISTINCT_ROOT to 0, for consistency + with other defines. + * modules/double-slash-root: New module. + * modules/dirname (Files): Remove m4/double-slash-root.m4. + (Depends-on): Add double-slash-root. + * MODULES.html.sh (File system functions): Mention new module. + 2006-12-14 Paul Eggert * lib/yesno.c [!ENABLE_NLS]: Don't include getline.h. diff --git a/MODULES.html.sh b/MODULES.html.sh index ec3b7d93a..9c0253b14 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -1978,6 +1978,7 @@ func_all_modules () func_module cycle-check func_module fsusage func_module dirfd + func_module double-slash-root func_module euidaccess func_module file-type func_module fileblocks diff --git a/lib/dirname.h b/lib/dirname.h index f9189c356..91e7ed336 100644 --- a/lib/dirname.h +++ b/lib/dirname.h @@ -48,7 +48,7 @@ # endif # ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT -# define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 +# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 # endif # if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4 index f8cbd54f3..69d60d011 100644 --- a/m4/double-slash-root.m4 +++ b/m4/double-slash-root.m4 @@ -1,4 +1,4 @@ -#serial 1 -*- autoconf -*- +# double-slash-root.m4 serial 2 -*- Autoconf -*- dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,37 +7,32 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_DOUBLE_SLASH_ROOT], [ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CACHE_CHECK([whether // is distinct from /], [ac_cv_double_slash_root], + AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root], [ if test x"$cross_compiling" = xyes ; then # When cross-compiling, there is no way to tell whether // is special # short of a list of hosts. However, the only known hosts to date - # that have a distinct // are Apollo DomainOS (too old to port to) - # and Cygwin. If anyone knows of another system for which // has + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has # special semantics and is distinct from /, please report it to - # . + # . case $host in - *-cygwin) - ac_cv_double_slash_root=yes ;; + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; *) # Be optimistic and assume that / and // are the same when we # don't know. - ac_cv_double_slash_root='unknown, assuming no' ;; + gl_cv_double_slash_root='unknown, assuming no' ;; esac else set x `ls -di / //` - if test $[2] = $[4]; then - ac_cv_double_slash_root=no + if test $[2] = $[4] && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no else - ac_cv_double_slash_root=yes + gl_cv_double_slash_root=yes fi fi]) - if test x"$ac_cv_double_slash_root" = xyes; then - ac_double_slash_root=1 - else - ac_double_slash_root=0 + if test "$gl_cv_double_slash_root" = yes; then + AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], 1, + [Define to 1 if // is a file system root distinct from /.]) fi - - AC_DEFINE_UNQUOTED([DOUBLE_SLASH_IS_DISTINCT_ROOT], - $ac_double_slash_root, - [Define to 1 if // is a file system root distinct from /.]) ]) diff --git a/modules/dirname b/modules/dirname index 1a8f15855..7c405c285 100644 --- a/modules/dirname +++ b/modules/dirname @@ -6,11 +6,11 @@ lib/dirname.h lib/dirname.c lib/basename.c lib/stripslash.c -m4/dos.m4 m4/dirname.m4 -m4/double-slash-root.m4 +m4/dos.m4 Depends-on: +double-slash-root stdbool xalloc xstrndup diff --git a/modules/double-slash-root b/modules/double-slash-root new file mode 100644 index 000000000..6b809d067 --- /dev/null +++ b/modules/double-slash-root @@ -0,0 +1,20 @@ +Description: +Check whether // is distinct from /. + +Files: +m4/double-slash-root.m4 + +Depends-on: + +configure.ac: +gl_DOUBLE_SLASH_ROOT + +Makefile.am: + +Include: + +License: +LGPL + +Maintainer: +Eric Blake, Paul Eggert, Jim Meyering -- 2.11.0