Skip to content

Commit 1cab27e

Browse files
committed
Windows skipif sections
1 parent 3df9917 commit 1cab27e

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

ext/gd/gd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,9 +1546,9 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
15461546
/* needs to be malloc (persistent) - GD will free() it later */
15471547
pstr = pestrndup(ZSTR_VAL(buff), ZSTR_LEN(buff), 1);
15481548
io_ctx = gdNewDynamicCtxEx(ZSTR_LEN(buff), pstr, 0);
1549+
pefree(pstr, 1);
1550+
zend_string_release_ex(buff, 0);
15491551
if (!io_ctx) {
1550-
pefree(pstr, 1);
1551-
zend_string_release_ex(buff, 0);
15521552
php_error_docref(NULL, E_WARNING,"Cannot allocate GD IO context");
15531553
goto out_err;
15541554
}
@@ -1559,8 +1559,6 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
15591559
im = (*ioctx_func_p)(io_ctx);
15601560
}
15611561
io_ctx->gd_free(io_ctx);
1562-
pefree(pstr, 1);
1563-
zend_string_release_ex(buff, 0);
15641562
}
15651563
/* try and force the stream to be FILE* */
15661564
else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) {

tests/output/sapi_windows_vt100_support_non_castable_user_stream.phpt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
sapi_windows_vt100_support(): uncastable user stream
33
--SKIPIF--
44
<?php
5-
if(PHP_OS_FAMILY !== "Windows") {
6-
echo "skip Only for Windows systems";
7-
} elseif (version_compare(
8-
PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD,
9-
'10.0.10586'
10-
) >= 0) {
11-
echo "skip Only for Windows systems < 10.0.10586";
5+
if (PHP_OS_FAMILY !== "Windows") {
6+
die("skip Only for Windows systems");
127
}
138
?>
149
--FILE--

tests/output/sapi_windows_vt100_support_stream_lose_data.phpt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
sapi_windows_vt100_support(): casting stream emits data loss
33
--SKIPIF--
44
<?php
5-
if(PHP_OS_FAMILY !== "Windows") {
6-
echo "skip Only for Windows systems";
7-
} elseif (version_compare(
8-
PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD,
9-
'10.0.10586'
10-
) >= 0) {
11-
echo "skip Only for Windows systems < 10.0.10586";
5+
if (PHP_OS_FAMILY !== "Windows") {
6+
die("skip Only for Windows systems");
127
}
138
require __DIR__ . '/../../ext/standard/tests/http/server.inc'; http_server_skipif();
149
?>

0 commit comments

Comments
 (0)