shire Tue Apr 3 19:50:43 2007 UTC
Modified files:
/php-src/ext/standard pack.c
/php-src/ext/standard/tests/strings pack.phpt
Log:
MFB: correction for previous fix to bug #38770 (pack/unpack is broken on
64bit)
fix pack test, correct space to tabs
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.66&r2=1.67&diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.66 php-src/ext/standard/pack.c:1.67
--- php-src/ext/standard/pack.c:1.66 Sat Feb 24 16:25:55 2007
+++ php-src/ext/standard/pack.c Tue Apr 3 19:50:43 2007
@@ -15,7 +15,7 @@
| Author: Chris Schneider <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: pack.c,v 1.66 2007/02/24 16:25:55 helly Exp $ */
+/* $Id: pack.c,v 1.67 2007/04/03 19:50:43 shire Exp $ */
#include "php.h"
@@ -738,7 +738,7 @@
issigned =
input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)] & 0x80;
} else if (sizeof(long) > 4 &&
(input[inputpos + machine_endian_long_map[3]] & 0x80) == 0x80) {
v = ~INT_MAX;
- }
+ }
v |=
php_unpack(&input[inputpos], sizeof(int), issigned, int_map);
add_assoc_long(return_value, n,
v);
@@ -753,15 +753,17 @@
int *map =
machine_endian_long_map;
long v = 0;
- if (type == 'l') {
+ if (type == 'l' || type == 'L')
{
issigned =
input[inputpos + (machine_little_endian ? 3 : 0)] & 0x80;
} else if (type == 'N') {
+ issigned =
input[inputpos] & 0x80;
map =
big_endian_long_map;
} else if (type == 'V') {
+ issigned =
input[inputpos + 3] & 0x80;
map =
little_endian_long_map;
}
- if (sizeof(long) > 4 &&
(input[inputpos + machine_endian_long_map[3]] & 0x80) == 0x80) {
+ if (sizeof(long) > 4 &&
issigned) {
v = ~INT_MAX;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/pack.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/standard/tests/strings/pack.phpt
diff -u php-src/ext/standard/tests/strings/pack.phpt:1.3
php-src/ext/standard/tests/strings/pack.phpt:1.4
--- php-src/ext/standard/tests/strings/pack.phpt:1.3 Sat Dec 30 02:01:09 2006
+++ php-src/ext/standard/tests/strings/pack.phpt Tue Apr 3 19:50:43 2007
@@ -145,7 +145,7 @@
)
Array
(
- [1] => 0
+ [1] => -1
)
Array
(
@@ -185,7 +185,7 @@
)
Array
(
- [1] => 0
+ [1] => -1
)
Array
(
@@ -233,7 +233,7 @@
)
Array
(
- [1] => 0
+ [1] => -1
)
Array
(
@@ -305,7 +305,7 @@
)
Array
(
- [1] => 0
+ [1] => -1
)
Array
(
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php