diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-03-17 20:10:03 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-03-17 20:10:03 +0200 |
commit | f961cdf2b5f7392cc1ced4ea0c13510792151e64 (patch) | |
tree | 73752d2b91f76ec75e9ac681c5c1f1f1107cabda /extension/readdir.c | |
parent | cc4a81433f96f0c93b5ab2c16673aea9ca2084ea (diff) | |
download | egawk-f961cdf2b5f7392cc1ced4ea0c13510792151e64.tar.gz egawk-f961cdf2b5f7392cc1ced4ea0c13510792151e64.tar.bz2 egawk-f961cdf2b5f7392cc1ced4ea0c13510792151e64.zip |
Fix readdir extension to use stat when dir info returns unknown.
Diffstat (limited to 'extension/readdir.c')
-rw-r--r-- | extension/readdir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extension/readdir.c b/extension/readdir.c index e8deecdd..cc1cd505 100644 --- a/extension/readdir.c +++ b/extension/readdir.c @@ -7,10 +7,11 @@ * * Andrew Schorr and Arnold Robbins: further fixes 8/2012. * Simplified 11/2012. + * Improved 3/2019. */ /* - * Copyright (C) 2012-2014, 2018 the Free Software Foundation, Inc. + * Copyright (C) 2012-2014, 2018, 2019 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -73,7 +74,7 @@ static const gawk_api_t *api; /* for convenience macros to work */ static awk_ext_id_t ext_id; -static const char *ext_version = "readdir extension: version 1.0"; +static const char *ext_version = "readdir extension: version 2.0"; static awk_bool_t init_readdir(void); static awk_bool_t (*init_func)(void) = init_readdir; @@ -103,9 +104,9 @@ ftype(struct dirent *entry, const char *dirname) case DT_REG: return "f"; case DT_SOCK: return "s"; default: - case DT_UNKNOWN: return "u"; + case DT_UNKNOWN: break; // JFS returns 'u', so fall through and stat } -#else +#endif char fname[PATH_MAX]; struct stat sbuf; @@ -133,7 +134,6 @@ ftype(struct dirent *entry, const char *dirname) #endif } return "u"; -#endif } /* get_inode --- get the inode of a file */ |