summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-06-14 16:02:21 +0200
committerOndřej Surý <ondrej@sury.org>2012-06-14 16:02:21 +0200
commitf0f8d7084aec4be5c07f02f2e29c2820f85c8315 (patch)
tree02e9b39d5b0088a0e27126010c96a748d824d055 /ext/standard
parent90ceaa9e92fadfef4c21ec0f76063c4387beb561 (diff)
downloadphp-f0f8d7084aec4be5c07f02f2e29c2820f85c8315.tar.gz
Imported Upstream version 5.4.4upstream/5.4.4
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/math.c20
-rw-r--r--ext/standard/proc_open.c2
-rw-r--r--ext/standard/tests/dir/dir_variation8-win32.phpt8
-rw-r--r--ext/standard/tests/file/popen_pclose_basic-win32.phpt5
-rw-r--r--ext/standard/tests/file/rename_variation13-win32.phptbin5058 -> 4692 bytes
-rw-r--r--ext/standard/tests/file/tempnam_variation7-win32.phpt4
-rw-r--r--ext/standard/tests/mail/mail_skipif.inc10
-rw-r--r--ext/standard/tests/math/bug62112.phptbin143 -> 0 bytes
8 files changed, 10 insertions, 39 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index b3e8c6f08..65187f6fa 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1097,9 +1097,7 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
return _php_math_number_format_ex(d, dec, &dec_point, 1, &thousand_sep, 1);
}
-static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
- size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len,
- int *result_len)
+PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
{
char *tmpbuf = NULL, *resbuf;
char *s, *t; /* source, target */
@@ -1207,19 +1205,8 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
efree(tmpbuf);
- if (result_len) {
- *result_len = reslen;
- }
-
return resbuf;
}
-
-PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point,
- size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
-{
- return _php_math_number_format_ex_len(d, dec, dec_point, dec_point_len,
- thousand_sep, thousand_sep_len, NULL);
-}
/* }}} */
/* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])
@@ -1254,10 +1241,7 @@ PHP_FUNCTION(number_format)
thousand_sep_len = 1;
}
- Z_TYPE_P(return_value) = IS_STRING;
- Z_STRVAL_P(return_value) = _php_math_number_format_ex_len(num, dec,
- dec_point, dec_point_len, thousand_sep, thousand_sep_len,
- &Z_STRLEN_P(return_value));
+ RETURN_STRING(_php_math_number_format_ex(num, dec, dec_point, dec_point_len, thousand_sep, thousand_sep_len), 0);
break;
default:
WRONG_PARAM_COUNT;
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 5ff91994a..4dd52ed28 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -56,7 +56,7 @@
/* This symbol is defined in ext/standard/config.m4.
* Essentially, it is set if you HAVE_FORK || PHP_WIN32
- * Other platforms may modify that configure check and add suitable #ifdefs
+ * Otherplatforms may modify that configure check and add suitable #ifdefs
* around the alternate code.
* */
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
diff --git a/ext/standard/tests/dir/dir_variation8-win32.phpt b/ext/standard/tests/dir/dir_variation8-win32.phpt
index a56c98b88..2202fb048 100644
--- a/ext/standard/tests/dir/dir_variation8-win32.phpt
+++ b/ext/standard/tests/dir/dir_variation8-win32.phpt
@@ -45,23 +45,23 @@ echo "Done";
*** Testing dir() : checking with wildcard characters ***
-- wildcard = '*' --
-Warning: dir(%s/dir_var*,%s/dir_var*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
+Warning: dir(%s/dir_var*,%s/dir_var*): No such file or directory in %s on line %d
Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
bool(false)
-Warning: dir(%s/*,%s/*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
+Warning: dir(%s/*,%s/*): No such file or directory in %s on line %d
Warning: dir(%s/*): failed to open dir: %s in %s on line %d
bool(false)
-- wildcard = '?' --
-Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
+Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): No such file or directory in %s on line %d
Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
bool(false)
-Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
+Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): No such file or directory in %s on line %d
Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
bool(false)
diff --git a/ext/standard/tests/file/popen_pclose_basic-win32.phpt b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
index 6351d866f..b5c72560d 100644
--- a/ext/standard/tests/file/popen_pclose_basic-win32.phpt
+++ b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
@@ -39,10 +39,7 @@ $arr = array("ggg", "ddd", "aaa", "sss");
//
// since we can't depend on PHP.ini being set a certain way,
// have to put the absolute path here.
-
-$sysroot = exec('echo %SYSTEMROOT%');
-
-$file_handle = popen("$sysroot/system32/sort", "w");
+$file_handle = popen("/windows/system32/sort", "w");
$newline = "\n";
foreach($arr as $str) {
fwrite($file_handle, (binary)$str);
diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt
index a5030761a..dc44b358f 100644
--- a/ext/standard/tests/file/rename_variation13-win32.phpt
+++ b/ext/standard/tests/file/rename_variation13-win32.phpt
Binary files differ
diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt
index 0c8caca95..1f0d97acf 100644
--- a/ext/standard/tests/file/tempnam_variation7-win32.phpt
+++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt
@@ -93,13 +93,13 @@ File created in => temp dir
Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d
-- File is not created --
-Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d
+Warning: unlink(): Invalid argument in %s on line %d
-- Iteration 7 --
Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d
-- File is not created --
-Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d
+Warning: unlink(): Invalid argument in %s on line %d
-- Iteration 8 --
File name is => %s%et%s
File permissions are => 100666
diff --git a/ext/standard/tests/mail/mail_skipif.inc b/ext/standard/tests/mail/mail_skipif.inc
index 006594021..2f4fbf3d6 100644
--- a/ext/standard/tests/mail/mail_skipif.inc
+++ b/ext/standard/tests/mail/mail_skipif.inc
@@ -1,15 +1,5 @@
<?php
extension_loaded('imap') or die('skip imap extension not available in this build');
-
-if( substr(PHP_OS, 0, 3) == 'WIN' && extension_loaded('sockets')) {
- // be sure mail server is accessible... on PHP 5.3.13 release build, using test-pack PHP-5.3-r1af8b3f,
- // the code below didn't skip test even though there was no mail server
- // test then failed (no mail server to test against)
- $socket = socket_create(AF_INET, SOCK_RAW, 1);
- socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 10, 'usec' => 10));
- // imap uses tcp port 143
- socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server");
-}
// Change these to make tests run successfully
$mailbox = '{localhost}';
diff --git a/ext/standard/tests/math/bug62112.phpt b/ext/standard/tests/math/bug62112.phpt
deleted file mode 100644
index 01de35a9c..000000000
--- a/ext/standard/tests/math/bug62112.phpt
+++ /dev/null
Binary files differ