diff options
author | jbj <devnull@localhost> | 1998-10-06 15:26:55 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1998-10-06 15:26:55 +0000 |
commit | 7a9831a86cb98687225976cced128748e0c1bd08 (patch) | |
tree | ea29cd859fe705c66465ee7d6e646be70f147ae0 /misc/glob.c | |
parent | a48ab753eee6ef2d4c45e73b1f3a3a566a8c4350 (diff) | |
download | rpm-7a9831a86cb98687225976cced128748e0c1bd08.tar.gz rpm-7a9831a86cb98687225976cced128748e0c1bd08.tar.bz2 rpm-7a9831a86cb98687225976cced128748e0c1bd08.zip |
more portable dirent handling (Hermann Lauer).
CVS patchset: 2401
CVS date: 1998/10/06 15:26:55
Diffstat (limited to 'misc/glob.c')
-rw-r--r-- | misc/glob.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/misc/glob.c b/misc/glob.c index 13190ab76..886e837ef 100644 --- a/misc/glob.c +++ b/misc/glob.c @@ -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, |