summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-02-25 10:52:37 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-02-25 10:53:06 -0800
commit3d50b6043ac61690f0b163a1618cfd5516238c81 (patch)
treef41c2033f0fc98645b4d76849f226736f31760c2
parent034c875de9bd7c3dd75d5d169b8b1082bd30eb99 (diff)
downloadgnulib-3d50b6043ac61690f0b163a1618cfd5516238c81.tar.gz
dirname: move m4/dos.m4 functionality into lib/dosname.h
m4/dos.m4 needs to go. It laboriously invokes the C compiler, and extracts symbols from it, puts them into config.h; but it's much easier to use the symbols directly. filename.h already does this, but it disagrees with dos.m4 in some respects. This patch introduces a different include file dosname.h that packages up dos.m4, and then later we can work on merging filename.h and dosname.h. Applications that need only the easy-to-configure symbols should consider including dosname.h rather than dirname.h. * NEWS: Mention incompatible changes. * m4/dos.m4: Remove. * lib/dosname.h, modules/dosname: New files. * lib/dirname.h (ISSLASH, FILE_SYSTEM_PREFIX_LEN): (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Move to lib/dosname.h. * lib/at-func.c, lib/at-func2.c, lib/openat.c, lib/savewd.c: Include dosname.h, not dirname.h. * lib/rmdir.c, lib/stat.c, lib/unlink.c, lib/unlinkat.c: Include dosname.h, for definitions of symbols like ISSLASH that used to be in config.h. * m4/dirname.m4 (gl_DIRNAME_LGPL): Do not require gl_AC_DOS. * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise. * modules/dirname-lgpl (Files): Omit m4/dos.m4. * modules/rmdir (Files): Likewise. * modules/stat (Files): Likewise. * modules/unlink (Files): Likewise. * modules/dirname-lgpl (Depends-on): Add dosname. * modules/lstat (Depends-on): Likewise. * modules/openat (Depends-on): Likewise. * modules/rmdir (Depends-on): Likewise. * modules/savewd (Depends-on): Likewise. * modules/stat (Depends-on): Likewise. * modules/unlink (Depends-on): Likewise. * modules/openat (Depends-on): Remove dirname-lgpl. * modules/savewd (Depends-on): Likewise. * tests/test-dirname.c: Do not use removed symbols like FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR. Instead, use the remaining symbols, e.g., ISSLASH ('\\').
-rw-r--r--ChangeLog44
-rw-r--r--NEWS11
-rw-r--r--lib/at-func.c2
-rw-r--r--lib/at-func2.c2
-rw-r--r--lib/dirname.h30
-rw-r--r--lib/dosname.h53
-rw-r--r--lib/openat.c2
-rw-r--r--lib/rmdir.c2
-rw-r--r--lib/savewd.c2
-rw-r--r--lib/stat.c1
-rw-r--r--lib/unlink.c2
-rw-r--r--lib/unlinkat.c1
-rw-r--r--m4/dirname.m43
-rw-r--r--m4/dos.m471
-rw-r--r--m4/rmdir.m43
-rw-r--r--m4/stat.m43
-rw-r--r--m4/unlink.m43
-rw-r--r--modules/dirname-lgpl2
-rw-r--r--modules/dosname20
-rw-r--r--modules/lstat1
-rw-r--r--modules/openat2
-rw-r--r--modules/rmdir2
-rw-r--r--modules/savewd2
-rw-r--r--modules/stat2
-rw-r--r--modules/unlink2
-rw-r--r--tests/test-dirname.c6
26 files changed, 153 insertions, 121 deletions
diff --git a/ChangeLog b/ChangeLog
index bdb7ac625a..6cae638218 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+2011-02-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ dirname: move m4/dos.m4 functionality into lib/dosname.h
+
+ m4/dos.m4 needs to go. It laboriously invokes the C compiler, and
+ extracts symbols from it, puts them into config.h; but it's much
+ easier to use the symbols directly. filename.h already does this,
+ but it disagrees with dos.m4 in some respects. This patch
+ introduces a different include file dosname.h that packages up
+ dos.m4, and then later we can work on merging filename.h and
+ dosname.h. Applications that need only the easy-to-configure
+ symbols should consider including dosname.h rather than dirname.h.
+ * NEWS: Mention incompatible changes.
+ * m4/dos.m4: Remove.
+ * lib/dosname.h, modules/dosname: New files.
+ * lib/dirname.h (ISSLASH, FILE_SYSTEM_PREFIX_LEN):
+ (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE):
+ (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Move to lib/dosname.h.
+ * lib/at-func.c, lib/at-func2.c, lib/openat.c, lib/savewd.c:
+ Include dosname.h, not dirname.h.
+ * lib/rmdir.c, lib/stat.c, lib/unlink.c, lib/unlinkat.c:
+ Include dosname.h, for definitions of symbols like ISSLASH
+ that used to be in config.h.
+ * m4/dirname.m4 (gl_DIRNAME_LGPL): Do not require gl_AC_DOS.
+ * m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
+ * m4/stat.m4 (gl_FUNC_STAT): Likewise.
+ * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
+ * modules/dirname-lgpl (Files): Omit m4/dos.m4.
+ * modules/rmdir (Files): Likewise.
+ * modules/stat (Files): Likewise.
+ * modules/unlink (Files): Likewise.
+ * modules/dirname-lgpl (Depends-on): Add dosname.
+ * modules/lstat (Depends-on): Likewise.
+ * modules/openat (Depends-on): Likewise.
+ * modules/rmdir (Depends-on): Likewise.
+ * modules/savewd (Depends-on): Likewise.
+ * modules/stat (Depends-on): Likewise.
+ * modules/unlink (Depends-on): Likewise.
+ * modules/openat (Depends-on): Remove dirname-lgpl.
+ * modules/savewd (Depends-on): Likewise.
+ * tests/test-dirname.c: Do not use removed symbols like
+ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR. Instead, use
+ the remaining symbols, e.g., ISSLASH ('\\').
+
2011-02-25 Eric Blake <eblake@redhat.com>
strstr: revert patches that introduced bug and pessimization
diff --git a/NEWS b/NEWS
index b203b2cf40..9a65c6af01 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,17 @@ User visible incompatible changes
Date Modules Changes
+2011-02-25 dirname These modules no longer put #defines for the
+ dirname-lgpl following symbols into <config.h>: ISSLASH,
+ backupfile FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX,
+ lstat FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR,
+ openat FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE.
+ remove Applications that need ISSLASH can include the new
+ rmdir header dosname.h.
+ savewd
+ stat
+ unlink
+
2011-02-14 getloadavg This module no longer #defines C_GETLOADAVG or
HAVE_GETLOADAVG, as the application no longer needs
to worry about how getloadavg is defined. It no
diff --git a/lib/at-func.c b/lib/at-func.c
index 31a75f175f..52868bcb96 100644
--- a/lib/at-func.c
+++ b/lib/at-func.c
@@ -16,7 +16,7 @@
/* written by Jim Meyering */
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "openat.h"
#include "openat-priv.h"
#include "save-cwd.h"
diff --git a/lib/at-func2.c b/lib/at-func2.c
index 29e6772da7..da691fef22 100644
--- a/lib/at-func2.c
+++ b/lib/at-func2.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <unistd.h>
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "filenamecat.h"
#include "openat.h"
#include "same-inode.h"
diff --git a/lib/dirname.h b/lib/dirname.h
index f089955542..2ef9882445 100644
--- a/lib/dirname.h
+++ b/lib/dirname.h
@@ -21,44 +21,16 @@
# include <stdbool.h>
# include <stddef.h>
+# include "dosname.h"
# ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
# endif
-# ifndef ISSLASH
-# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
-# endif
-
-# ifndef FILE_SYSTEM_PREFIX_LEN
-# if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
- /* This internal macro assumes ASCII, but all hosts that support drive
- letters use ASCII. */
-# define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \
- <= 'z' - 'a')
-# define FILE_SYSTEM_PREFIX_LEN(Filename) \
- (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
-# else
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-# endif
-# endif
-
-# ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
-# endif
-
# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
# endif
-# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
-# else
-# define IS_ABSOLUTE_FILE_NAME(F) \
- (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F))
-# endif
-# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
-
# if GNULIB_DIRNAME
char *base_name (char const *file);
char *dir_name (char const *file);
diff --git a/lib/dosname.h b/lib/dosname.h
new file mode 100644
index 0000000000..acdd03b156
--- /dev/null
+++ b/lib/dosname.h
@@ -0,0 +1,53 @@
+/* File names on MS-DOS/Windows systems.
+
+ Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ From Paul Eggert and Jim Meyering. */
+
+#ifndef _DOSNAME_H
+#define _DOSNAME_H
+
+#if (defined _WIN32 || defined __WIN32__ || \
+ defined __MSDOS__ || defined __CYGWIN__ || \
+ defined __EMX__ || defined __DJGPP__)
+ /* This internal macro assumes ASCII, but all hosts that support drive
+ letters use ASCII. */
+# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
+ <= 'z' - 'a')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
+# ifndef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+#endif
+
+#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(F) \
+ (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
+#endif
+#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
+
+#endif /* DOSNAME_H_ */
diff --git a/lib/openat.c b/lib/openat.c
index 939e3c70d7..18491a6f6d 100644
--- a/lib/openat.c
+++ b/lib/openat.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <sys/stat.h>
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
#include "openat-priv.h"
#include "save-cwd.h"
diff --git a/lib/rmdir.c b/lib/rmdir.c
index 8e02c37ad9..d7395a515b 100644
--- a/lib/rmdir.c
+++ b/lib/rmdir.c
@@ -23,6 +23,8 @@
#include <errno.h>
#include <string.h>
+#include "dosname.h"
+
#undef rmdir
/* Remove directory DIR.
diff --git a/lib/savewd.c b/lib/savewd.c
index 982e73f7f8..f19e98e354 100644
--- a/lib/savewd.c
+++ b/lib/savewd.c
@@ -31,7 +31,7 @@
#include <sys/wait.h>
#include <unistd.h>
-#include "dirname.h"
+#include "dosname.h"
#include "fcntl-safer.h"
/* Save the working directory into *WD, if it hasn't been saved
diff --git a/lib/stat.c b/lib/stat.c
index f16d9144af..cbc9100fd4 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -37,6 +37,7 @@ orig_stat (const char *filename, struct stat *buf)
#include <limits.h>
#include <stdbool.h>
#include <string.h>
+#include "dosname.h"
/* Store information about NAME into ST. Work around bugs with
trailing slashes. Mingw has other bugs (such as st_ino always
diff --git a/lib/unlink.c b/lib/unlink.c
index 7b14d8035f..677d58493d 100644
--- a/lib/unlink.c
+++ b/lib/unlink.c
@@ -24,6 +24,8 @@
#include <string.h>
#include <sys/stat.h>
+#include "dosname.h"
+
#undef unlink
/* Remove file NAME.
diff --git a/lib/unlinkat.c b/lib/unlinkat.c
index 9f1894ac26..fd1c69e730 100644
--- a/lib/unlinkat.c
+++ b/lib/unlinkat.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <sys/stat.h>
+#include "dosname.h"
#include "openat.h"
#if HAVE_UNLINKAT
diff --git a/m4/dirname.m4 b/m4/dirname.m4
index d0b439f553..9d5f40d1c2 100644
--- a/m4/dirname.m4
+++ b/m4/dirname.m4
@@ -1,4 +1,4 @@
-#serial 8 -*- autoconf -*-
+#serial 9 -*- autoconf -*-
dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,6 @@ AC_DEFUN([gl_DIRNAME_LGPL],
AC_LIBOBJ([stripslash])
dnl Prerequisites of lib/dirname.h.
- AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
diff --git a/m4/dos.m4 b/m4/dos.m4
deleted file mode 100644
index ed9c4cee67..0000000000
--- a/m4/dos.m4
+++ /dev/null
@@ -1,71 +0,0 @@
-#serial 11 -*- autoconf -*-
-
-# Define some macros required for proper operation of code in lib/*.c
-# on MSDOS/Windows systems.
-
-# Copyright (C) 2000-2001, 2004-2006, 2009-2011 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.
-
-# From Jim Meyering.
-
-AC_DEFUN([gl_AC_DOS],
- [
- AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
- [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
-#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
-neither MSDOS nor Windows
-#endif]])],
- [ac_cv_win_or_dos=yes],
- [ac_cv_win_or_dos=no])
- ])
-
- if test x"$ac_cv_win_or_dos" = xyes; then
- ac_fs_accepts_drive_letter_prefix=1
- ac_fs_backslash_is_file_name_separator=1
- AC_CACHE_CHECK([whether drive letter can start relative path],
- [ac_cv_drive_letter_can_be_relative],
- [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
-#if defined __CYGWIN__
-drive letters are always absolute
-#endif]])],
- [ac_cv_drive_letter_can_be_relative=yes],
- [ac_cv_drive_letter_can_be_relative=no])
- ])
- if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
- ac_fs_drive_letter_can_be_relative=1
- else
- ac_fs_drive_letter_can_be_relative=0
- fi
- else
- ac_fs_accepts_drive_letter_prefix=0
- ac_fs_backslash_is_file_name_separator=0
- ac_fs_drive_letter_can_be_relative=0
- fi
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
- $ac_fs_accepts_drive_letter_prefix,
- [Define on systems for which file names may have a so-called
- `drive letter' prefix, define this to compute the length of that
- prefix, including the colon.])
-
- AH_VERBATIM(ISSLASH,
- [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define ISSLASH(C) ((C) == '/')
-#endif])
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
- $ac_fs_backslash_is_file_name_separator,
- [Define if the backslash character may also serve as a file name
- component separator.])
-
- AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
- $ac_fs_drive_letter_can_be_relative,
- [Define if a drive letter prefix denotes a relative path if it is
- not followed by a file name component separator.])
- ])
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
index 16402a5815..41705a1ee4 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,4 +1,4 @@
-# rmdir.m4 serial 9
+# rmdir.m4 serial 10
dnl Copyright (C) 2002, 2005, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_RMDIR],
[
- AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
dnl Detect cygwin 1.5.x bug.
AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
diff --git a/m4/stat.m4 b/m4/stat.m4
index 4883fe25ee..27f82d5a91 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,4 +1,4 @@
-# serial 6
+# serial 7
# Copyright (C) 2009-2011 Free Software Foundation, Inc.
#
@@ -9,7 +9,6 @@
AC_DEFUN([gl_FUNC_STAT],
[
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([lstat])
dnl mingw is the only known platform where stat(".") and stat("./") differ
diff --git a/m4/unlink.m4 b/m4/unlink.m4
index 6d5d3d3f42..a49a692878 100644
--- a/m4/unlink.m4
+++ b/m4/unlink.m4
@@ -1,4 +1,4 @@
-# unlink.m4 serial 6
+# unlink.m4 serial 7
dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_UNLINK],
[
- AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
dnl Detect FreeBSD 7.2, AIX 7.1, Solaris 9 bug.
diff --git a/modules/dirname-lgpl b/modules/dirname-lgpl
index 38f779abde..b380ff98e6 100644
--- a/modules/dirname-lgpl
+++ b/modules/dirname-lgpl
@@ -7,9 +7,9 @@ lib/dirname-lgpl.c
lib/basename-lgpl.c
lib/stripslash.c
m4/dirname.m4
-m4/dos.m4
Depends-on:
+dosname
double-slash-root
malloc-posix
stdbool
diff --git a/modules/dosname b/modules/dosname
new file mode 100644
index 0000000000..0e8703cb33
--- /dev/null
+++ b/modules/dosname
@@ -0,0 +1,20 @@
+Description:
+Macros for porting to systems with DOS-style file names.
+
+Files:
+lib/dosname.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+"dosname.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Eric Blake, Paul Eggert, Jim Meyering
diff --git a/modules/lstat b/modules/lstat
index e4eabb5ac9..e53ac7ed70 100644
--- a/modules/lstat
+++ b/modules/lstat
@@ -6,6 +6,7 @@ lib/lstat.c
m4/lstat.m4
Depends-on:
+dosname
stat
sys_stat
diff --git a/modules/openat b/modules/openat
index 37cae80fa0..35917c59d7 100644
--- a/modules/openat
+++ b/modules/openat
@@ -16,7 +16,7 @@ m4/openat.m4
m4/mode_t.m4
Depends-on:
-dirname-lgpl
+dosname
errno
extensions
fchdir
diff --git a/modules/rmdir b/modules/rmdir
index d047e4c5a0..eaa5a68542 100644
--- a/modules/rmdir
+++ b/modules/rmdir
@@ -3,10 +3,10 @@ rmdir() function: delete a directory.
Files:
lib/rmdir.c
-m4/dos.m4
m4/rmdir.m4
Depends-on:
+dosname
sys_stat
unistd
diff --git a/modules/savewd b/modules/savewd
index 41f51e31d3..1f32372849 100644
--- a/modules/savewd
+++ b/modules/savewd
@@ -7,7 +7,7 @@ lib/savewd.c
m4/savewd.m4
Depends-on:
-dirname-lgpl
+dosname
errno
exit
fchdir
diff --git a/modules/stat b/modules/stat
index 1ad5e908ee..744aa7a0cb 100644
--- a/modules/stat
+++ b/modules/stat
@@ -3,10 +3,10 @@ stat() function: query file information
Files:
lib/stat.c
-m4/dos.m4
m4/stat.m4
Depends-on:
+dosname
stdbool
sys_stat
diff --git a/modules/unlink b/modules/unlink
index 4c8c649581..a27a308dce 100644
--- a/modules/unlink
+++ b/modules/unlink
@@ -3,10 +3,10 @@ unlink() function: remove a file.
Files:
lib/unlink.c
-m4/dos.m4
m4/unlink.m4
Depends-on:
+dosname
lstat
unistd
diff --git a/tests/test-dirname.c b/tests/test-dirname.c
index bda1ee874a..1ddf229b58 100644
--- a/tests/test-dirname.c
+++ b/tests/test-dirname.c
@@ -54,7 +54,7 @@ static struct test tests[] = {
{"", ".", "", "", "", false, false},
{".", ".", ".", ".", ".", false, false},
{"..", ".", "..", "..", "..", false, false},
-#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
+#if ISSLASH ('\\')
{"a\\", ".", "a\\", "a\\", "a", true, false},
{"a\\b", "a", "b", "b", "a\\b", false, false},
{"\\", "\\", "", "\\", "\\", false, true},
@@ -75,7 +75,7 @@ static struct test tests[] = {
{"//\\", "/", "\\", "\\", "//\\", false, true},
# endif
#endif
-#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
+#if ISSLASH ('\\')
# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
{"c:", "c:", "", "c:", "c:", false, false},
{"c:/", "c:/", "", "c:/", "c:/", false, true},
@@ -105,7 +105,7 @@ static struct test tests[] = {
{"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false},
{"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false},
# endif
-#else /* ! FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX */
+#else /* ! ISSLASH ('\\') */
{"c:", ".", "c:", "c:", "c:", false, false},
{"c:/", ".", "c:/", "c:/", "c:", true, false},
{"c://", ".", "c://", "c:/", "c:", true, false},