more portable dirent handling (Hermann Lauer).
authorjbj <devnull@localhost>
Tue, 6 Oct 1998 15:26:55 +0000 (15:26 +0000)
committerjbj <devnull@localhost>
Tue, 6 Oct 1998 15:26:55 +0000 (15:26 +0000)
CVS patchset: 2401
CVS date: 1998/10/06 15:26:55

CHANGES
configure.in
misc/glob.c

diff --git a/CHANGES b/CHANGES
index e9eb441..c521203 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,5 @@
 2.5.5 -> 2.9
+       - more portable dirent handling (Hermann Lauer).
        - add Slovak translation (Stanislav Meduna <stano@trillian.eunet.sk>)
        - gettextify rpmMessage/rpmError/fprintf messages.
        - update po files; add cz to catalogs.
index 61cf94b..c2bbb98 100644 (file)
@@ -351,7 +351,8 @@ dnl Checks for header files we can live without.
 AC_HEADER_STDC
 AC_HEADER_MAJOR
 AC_CHECK_HEADERS(netinet/in_systm.h limits.h)
-AC_CHECK_HEADERS(alloca.h dirent.h sys/socket.h sys/select.h)
+AC_CHECK_HEADERS(alloca.h sys/socket.h sys/select.h)
+AC_HEADER_DIRENT
 AC_CHECK_HEADERS(machine/types.h string.h)
 AC_CHECK_HEADERS(sys/types.h sys/stdtypes.h unistd.h)
 AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
index 13190ab..886e837 100644 (file)
@@ -1,15 +1,3 @@
-#ifdef __sgi
-#define SYSDIR
-#endif
-
-#ifdef __hpux
-#define SYSDIR
-#endif
-
-#if defined(sun) && !defined(__svr4__)
-#define SYSDIR
-#endif
-
 /* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 
 This library is free software; you can redistribute it and/or
@@ -66,27 +54,6 @@ extern int errno;
 #define        NULL    0
 #endif
 
-#if    defined (POSIX) || defined (DIRENT) || defined (__GNU_LIBRARY__)  || defined(HAVE_DIRENT_H)
-#include <dirent.h>
-#ifndef        __GNU_LIBRARY__
-#define D_NAMLEN(d) strlen((d)->d_name)
-#else  /* GNU C library.  */
-#define D_NAMLEN(d) ((d)->d_namlen)
-#endif /* Not GNU C library.  */
-#else  /* Not POSIX or DIRENT.  */
-#define direct dirent
-#define D_NAMLEN(d) ((d)->d_namlen)
-#ifdef SYSNDIR
-#include <sys/ndir.h>
-#endif /* SYSNDIR */
-#ifdef SYSDIR
-#include <sys/dir.h>
-#endif /* SYSDIR */
-#ifdef NDIR
-#include <ndir.h>
-#endif /* NDIR */
-#endif /* POSIX or DIRENT or __GNU_LIBRARY__.  */
-
 #if defined (POSIX) && !defined (__GNU_LIBRARY__)
 /* Posix does not require that the d_ino field be present, and some
    systems do not provide it. */
@@ -578,11 +545,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
                if (! REAL_DIR_ENTRY (d))
                  continue;
                name = d->d_name;
-#ifdef HAVE_D_NAMLEN
-               len = d->d_namlen;
-#else
-               len = 0;
-#endif
+               len = NLENGTH(d);
              }
                
            if (fnmatch (pattern, name,