Skip to content

Commit 448f74d

Browse files
committed
Fix Windows tests
1 parent da80b64 commit 448f74d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

ext/standard/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ PHP_FUNCTION(popen)
947947
/* Musl only partially validates the mode. Manually check it to ensure consistent behavior. */
948948
if (mode_len > 2 ||
949949
(mode_len == 1 && (*posix_mode != 'r' && *posix_mode != 'w')) ||
950-
(mode_len == 2 && (memcmp(posix_mode, "rb", 2) || memcmp(posix_mode, "wb", 2)))
950+
(mode_len == 2 && (memcmp(posix_mode, "rb", 2) && memcmp(posix_mode, "wb", 2)))
951951
) {
952952
zend_argument_value_error(2, "must be one of \"r\", \"rb\", \"w\", or \"wb\"");
953953
efree(posix_mode);

ext/standard/tests/file/glob_error_002-win32.phpt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ if(substr(PHP_OS, 0, 3) != "WIN")
1111
<?php
1212
echo "*** Testing glob() : error condition - pattern too long. ***\n";
1313

14-
try {
15-
glob(str_repeat('x', 3000));
16-
} catch (ValueError $exception) {
17-
echo $exception->getMessage() . "\n";
18-
}
14+
glob(str_repeat('x', 3000));
1915

2016
echo "Done";
2117
?>
2218
--EXPECTF--
2319
*** Testing glob() : error condition - pattern too long. ***
24-
glob(): Argument #1 ($pattern) must have a length less than %d bytes
20+
21+
Warning: glob(): Pattern exceeds the maximum allowed length of %d characters in %s on line %d
2522
Done

0 commit comments

Comments
 (0)