From af14c9a76d7201bac5451ae4bc471cd164566e81 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 30 Jul 1994 12:10:53 +0000 Subject: [PATCH] . --- lib/savedir.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/lib/savedir.c b/lib/savedir.c index fce61da0d..b831c1fe9 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -15,28 +15,41 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Written by David MacKenzie . */ +/* Written by David MacKenzie . */ + +#ifdef HAVE_CONFIG_H +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif #include + +#ifdef HAVE_UNISTD_H +#include +#endif + #ifdef DIRENT #include -#ifdef direct -#undef direct -#endif -#define direct dirent #define NLENGTH(direct) (strlen((direct)->d_name)) -#else +#else /* not DIRENT */ +#define dirent direct #define NLENGTH(direct) ((direct)->d_namlen) -#ifdef USG #ifdef SYSNDIR #include -#else -#include -#endif -#else +#endif /* SYSNDIR */ +#ifdef SYSDIR #include -#endif -#endif +#endif /* SYSDIR */ +#ifdef NDIR +#include +#endif /* NDIR */ +#endif /* DIRENT */ #ifdef VOID_CLOSEDIR /* Fake a return value. */ @@ -71,7 +84,7 @@ savedir (dir, name_size) unsigned name_size; { DIR *dirp; - struct direct *dp; + struct dirent *dp; char *name_space; char *namep; -- 2.11.0