diff options
author | Andy Wingo <wingo@pobox.com> | 2011-07-25 18:26:37 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-07-25 18:26:37 +0200 |
commit | ab4bc85398a14b62b58694bab83c63be286b2fd5 (patch) | |
tree | 84bfe7b0b6064016bcfadb76ec95d07410654fe8 /lib/stat.c | |
parent | f29c300507da21a667f5b82e75300f8009eab9cc (diff) | |
parent | f4b7d918eff9770f09893b023fd834f5c0bc33d1 (diff) | |
download | guile-ab4bc85398a14b62b58694bab83c63be286b2fd5.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
GUILE-VERSION
test-suite/tests/srfi-4.test
Diffstat (limited to 'lib/stat.c')
-rw-r--r-- | lib/stat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/stat.c b/lib/stat.c index aa369d0f2..b203172fe 100644 --- a/lib/stat.c +++ b/lib/stat.c @@ -38,6 +38,7 @@ orig_stat (const char *filename, struct stat *buf) #include <stdbool.h> #include <string.h> #include "dosname.h" +#include "verify.h" /* Store information about NAME into ST. Work around bugs with trailing slashes. Mingw has other bugs (such as st_ino always @@ -63,6 +64,12 @@ rpl_stat (char const *name, struct stat *st) } #endif /* REPLACE_FUNC_STAT_FILE */ #if REPLACE_FUNC_STAT_DIR + /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also + have a constant PATH_MAX. */ +# ifndef PATH_MAX +# error "Please port this replacement to your platform" +# endif + if (result == -1 && errno == ENOENT) { /* Due to mingw's oddities, there are some directories (like @@ -77,6 +84,7 @@ rpl_stat (char const *name, struct stat *st) char fixed_name[PATH_MAX + 1] = {0}; size_t len = strlen (name); bool check_dir = false; + verify (PATH_MAX <= 4096); if (PATH_MAX <= len) errno = ENAMETOOLONG; else if (len) |