diff options
Diffstat (limited to 'main/php_scandir.c')
| -rw-r--r-- | main/php_scandir.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/main/php_scandir.c b/main/php_scandir.c index 76628528a4..7fdb49b77a 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -42,9 +42,7 @@ #ifndef HAVE_ALPHASORT -#ifdef HAVE_STRING_H #include <string.h> -#endif PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b) { @@ -59,8 +57,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se struct dirent **vector = NULL; int vector_size = 0; int nfiles = 0; - char entry[sizeof(struct dirent)+MAXPATHLEN]; - struct dirent *dp = (struct dirent *)&entry; + struct dirent *dp; if (namelist == NULL) { return -1; @@ -70,7 +67,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se return -1; } - while (!php_readdir_r(dirp, (struct dirent *)entry, &dp) && dp) { + while ((dp = readdir(dirp))) { size_t dsize = 0; struct dirent *newdp = NULL; @@ -121,12 +118,3 @@ fail: return -1; } #endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ |
