File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ PHP NEWS
20
20
(cmb)
21
21
. Fixed bug #79368 ("Unexpected end of file" is not an acceptable error
22
22
message). (Alex Dowad)
23
+ . Fixed bug #36365 (scandir duplicates file name at every 65535th file).
24
+ (cmb)
23
25
24
26
- BZ2:
25
27
. Fixed bug #71263 (fread() does not report bzip2.decompress errors). (cmb)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #36365 (scandir duplicates file name at every 65535th file)
3
+ --SKIPIF--
4
+ <?php
5
+ if (getenv ("SKIP_SLOW_TESTS " )) die ('skip slow test ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ testdir = __DIR__ . '/bug36365 ' ;
10
+
11
+ mkdir ($ testdir );
12
+ for ($ i = 0 ; $ i < 70000 ; $ i ++) {
13
+ touch (sprintf ("$ testdir/%05d.txt " , $ i ));
14
+ }
15
+
16
+ var_dump (count (scandir ($ testdir )));
17
+ ?>
18
+ --CLEAN--
19
+ <?php
20
+ $ testdir = __DIR__ . '/bug36365 ' ;
21
+ for ($ i = 0 ; $ i < 70000 ; $ i ++) {
22
+ unlink (sprintf ("$ testdir/%05d.txt " , $ i ));
23
+ }
24
+ rmdir ($ testdir );
25
+ ?>
26
+ --EXPECT--
27
+ int(70002)
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ struct dirent {
26
26
/* typedef DIR - not the same as Unix */
27
27
struct DIR_W32 {
28
28
HANDLE handle ; /* _findfirst/_findnext handle */
29
- uint16_t offset ; /* offset into directory */
29
+ uint32_t offset ; /* offset into directory */
30
30
uint8_t finished ; /* 1 if there are not more files */
31
31
WIN32_FIND_DATAW fileinfo ; /* from _findfirst/_findnext */
32
32
wchar_t * dirw ; /* the dir we are reading */
You can’t perform that action at this time.
0 commit comments