com php-src: Merge remote-tracking branch 'origin/master' into str_size_and_int64: ext/ftp/ftp.c ext/ftp/php _ftp.c ext/gmp/gmp.c
ext/gmp/tests/005.phpt ext/sockets/sockets.c main/SAPI.c
| From: | Anatol Belski | Date: | Thu, 02 Jan 2014 08:55:25 +0000 |
| Subject: | com php-src: Merge remote-tracking branch 'origin/master' into str_size_and_int64: ext/ftp/ftp.c ext/ftp/php _ftp.c ext/gmp/gmp.c ext/gmp/tests/005.phpt ext/sockets/sockets.c main/SAPI.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75521@lists.php.net to get a copy of this message | ||
Commit: 826064410c21cf53e2f666a4ad81ae32e78b29cc
Author: Anatol Belski <ab@php.net> Thu, 2 Jan 2014 09:55:25 +0100
Parents: 9ac081f295ec187a6b631bd1a7aebcbfccb2806c 9e4ab7c53fecb096ce0956c4aa138912ab80fa5a
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=826064410c21cf53e2f666a4ad81ae32e78b29cc
Log:
Merge remote-tracking branch 'origin/master' into str_size_and_int64
Conflicts:
ext/gmp/gmp.c
Changed paths:
MM ext/ftp/ftp.c
MM ext/ftp/php_ftp.c
MM ext/gmp/gmp.c
MM ext/gmp/tests/005.phpt
MM ext/sockets/sockets.c
MM main/SAPI.c
Diff:
diff --cc ext/ftp/php_ftp.c
index 4421a6f,99f3808..23f850a
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@@ -963,16 -963,18 +963,18 @@@ PHP_FUNCTION(ftp_nb_get
if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
php_stream_close(outstream);
+ ftp->stream = NULL;
VCWD_UNLINK(local);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
- RETURN_LONG(PHP_FTP_FAILED);
+ RETURN_INT(PHP_FTP_FAILED);
}
if (ret == PHP_FTP_FINISHED){
php_stream_close(outstream);
+ ftp->stream = NULL;
}
- RETURN_LONG(ret);
+ RETURN_INT(ret);
}
/* }}} */
diff --cc ext/gmp/gmp.c
index 071e7df,c02b462..e1325d0
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@@ -714,20 -714,20 +714,20 @@@ ZEND_MODULE_INFO_D(gmp
/* {{{ convert_to_gmp
* Convert zval to be gmp number */
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, php_int_t base TSRMLS_DC)
{
switch (Z_TYPE_P(val)) {
- case IS_LONG:
+ case IS_INT:
- case IS_BOOL:
- case IS_CONSTANT: {
+ case IS_BOOL: {
mpz_set_si(gmpnumber, gmp_get_long(val));
return SUCCESS;
}
case IS_STRING: {
char *numstr = Z_STRVAL_P(val);
int skip_lead = 0;
+ int ret;
- if (Z_STRLEN_P(val) > 2) {
+ if (Z_STRSIZE_P(val) > 2) {
if (numstr[0] == '0') {
if (numstr[1] == 'x' || numstr[1] == 'X') {
base = 16;
diff --cc ext/gmp/tests/005.phpt
index 62363e2,79fd73e..df3e596
--- a/ext/gmp/tests/005.phpt
+++ b/ext/gmp/tests/005.phpt
@@@ -36,9 -36,11 +36,11 @@@ echo "Done\n"
--EXPECTF--
Warning: gmp_strval() expects at least 1 parameter, 0 given in %s on line %d
NULL
+
+ Warning: gmp_strval(): Unable to convert variable to GMP - string is not an integer in %s on line
%d
bool(false)
-Warning: gmp_strval() expects parameter 2 to be long, string given in %s on line %d
+Warning: gmp_strval() expects parameter 2 to be integer, string given in %s on line %d
NULL
Warning: gmp_strval(): Bad base for conversion: -1 (should be between 2 and %d or -2 and -%d) in
%s on line %d