diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-11-26 18:59:32 +0100 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2009-11-26 18:59:32 +0100 |
commit | c6a5ea308f00ad89b2f8b90d174f2591bcac3b02 (patch) | |
tree | e03a727463910129e1ad83c5454f18f01ca004e9 /src | |
parent | 9b5e7d42e0abd88bb6c01a145f5171bc0fb7d84c (diff) | |
download | grep-c6a5ea308f00ad89b2f8b90d174f2591bcac3b02.tar.gz |
replace AC_DOSFILE with gnulib modules
* bootstrap.conf: Add binary-io, dirname.
* configure.ac: Remove check for setmode, AC_DOSFILE.
* m4/dosfile.m4: Remove.
* src/grep.c: Adjust for dirname.h.
* src/system.h: Adjust for new gnulib modules.
Diffstat (limited to 'src')
-rw-r--r-- | src/grep.c | 4 | ||||
-rw-r--r-- | src/system.h | 27 |
2 files changed, 6 insertions, 25 deletions
@@ -1369,8 +1369,8 @@ grepdir (char const *dir, struct stats const *stats) else { size_t dirlen = strlen (dir); - int needs_slash = ! (dirlen == FILESYSTEM_PREFIX_LEN (dir) - || IS_SLASH (dir[dirlen - 1])); + int needs_slash = ! (dirlen == FILE_SYSTEM_PREFIX_LEN (dir) + || ISSLASH (dir[dirlen - 1])); char *file = NULL; char const *namep = name_space; struct stats child; diff --git a/src/system.h b/src/system.h index 5bb06262..a03ddcea 100644 --- a/src/system.h +++ b/src/system.h @@ -35,30 +35,11 @@ #include <unistd.h> #include <errno.h> -/* Some operating systems treat text and binary files differently. */ -#ifdef __BEOS__ -# undef O_BINARY /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ -#endif -#ifdef HAVE_DOS_FILE_CONTENTS -# include <io.h> -# ifdef HAVE_SETMODE -# define SET_BINARY(fd) setmode (fd, O_BINARY) -# else -# define SET_BINARY(fd) _setmode (fd, O_BINARY) -# endif -#endif - -#ifdef HAVE_DOS_FILE_NAMES -# define IS_SLASH(c) ((c) == '/' || (c) == '\\') -# define FILESYSTEM_PREFIX_LEN(f) ((f)[0] && (f)[1] == ':' ? 2 : 0) -#endif - -#ifndef IS_SLASH -# define IS_SLASH(c) ((c) == '/') -#endif +#include "binary-io.h" +#include "dirname.h" -#ifndef FILESYSTEM_PREFIX_LEN -# define FILESYSTEM_PREFIX_LEN(f) 0 +#if O_BINARY +# define HAVE_DOS_FILE_CONTENTS 1 #endif int isdir PARAMS ((char const *)); |