tony2001                Thu Aug 31 14:21:21 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       string.c 
  Log:
  more z/Z fixes
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.18&r2=1.445.2.14.2.19&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.18 
php-src/ext/standard/string.c:1.445.2.14.2.19
--- php-src/ext/standard/string.c:1.445.2.14.2.18       Tue Aug 29 19:50:04 2006
+++ php-src/ext/standard/string.c       Thu Aug 31 14:21:21 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.18 2006/08/29 19:50:04 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.19 2006/08/31 14:21:21 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1741,22 +1741,22 @@
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strrpos)
 {
-       zval *zneedle;
+       zval **zneedle;
        char *needle, *haystack;
        int needle_len, haystack_len;
        long offset = 0;
        char *p, *e, ord_needle[2];
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, 
&haystack_len, &zneedle, &offset) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, 
&haystack_len, &zneedle, &offset) == FAILURE) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_P(zneedle) == IS_STRING) {
-               needle = Z_STRVAL_P(zneedle);
-               needle_len = Z_STRLEN_P(zneedle);
+       if (Z_TYPE_PP(zneedle) == IS_STRING) {
+               needle = Z_STRVAL_PP(zneedle);
+               needle_len = Z_STRLEN_PP(zneedle);
        } else {
-               convert_to_long(zneedle);
-               ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+               convert_to_long_ex(zneedle);
+               ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
                ord_needle[1] = '\0';
                needle = ord_needle;
                needle_len = 1;
@@ -1806,23 +1806,23 @@
    Finds position of last occurrence of a string within another string */
 PHP_FUNCTION(strripos)
 {
-       zval *zneedle;
+       zval **zneedle;
        char *needle, *haystack;
        int needle_len, haystack_len;
        long offset = 0;
        char *p, *e, ord_needle[2];
        char *needle_dup, *haystack_dup;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, 
&haystack_len, &zneedle, &offset) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, 
&haystack_len, &zneedle, &offset) == FAILURE) {
                RETURN_FALSE;
        }
 
-       if (Z_TYPE_P(zneedle) == IS_STRING) {
-               needle = Z_STRVAL_P(zneedle);
-               needle_len = Z_STRLEN_P(zneedle);
+       if (Z_TYPE_PP(zneedle) == IS_STRING) {
+               needle = Z_STRVAL_PP(zneedle);
+               needle_len = Z_STRLEN_PP(zneedle);
        } else {
-               convert_to_long(zneedle);
-               ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+               convert_to_long_ex(zneedle);
+               ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
                ord_needle[1] = '\0';
                needle = ord_needle;
                needle_len = 1;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to