From 17f2dda0acc8f97e40819d75d99d85283d9027a1 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 7 Feb 2000 19:54:04 +0000 Subject: * Fix for dir.c from Andreas Schwab. * Fix += target-specific variables: if your direct parent doesn't have a setting for the variable but his parent does, you'll get recursive expansion errors. --- dir.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index caa8042..9221c44 100644 --- a/dir.c +++ b/dir.c @@ -1058,6 +1058,9 @@ read_dirstream (stream) FAKE_DIR_ENTRY (d); #ifdef _DIRENT_HAVE_D_NAMLEN d->d_namlen = len - 1; +#endif +#ifdef _DIRENT_HAVE_D_TYPE + d->d_type = DT_UNKNOWN; #endif memcpy (d->d_name, df->name, len); return d; @@ -1079,19 +1082,33 @@ ansi_free(p) free(p); } +/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a + * macro for stat64(). If stat is a macro, make a local wrapper function to + * invoke it. + */ +#ifndef stat +# ifndef VMS +extern int stat (); +# endif +# define local_stat stat +#else +static int local_stat (path, buf) + char *path; + struct stat *buf; +{ + return stat (path, buf); +} +#endif + void dir_setup_glob (gl) glob_t *gl; { -#ifndef VMS - extern int stat (); -#endif - /* Bogus sunos4 compiler complains (!) about & before functions. */ gl->gl_opendir = open_dirstream; gl->gl_readdir = read_dirstream; gl->gl_closedir = ansi_free; - gl->gl_stat = stat; + gl->gl_stat = local_stat; /* We don't bother setting gl_lstat, since glob never calls it. The slot is only there for compatibility with 4.4 BSD. */ } -- cgit v1.2.3