]> granicus.if.org Git - php/commitdiff
FALSE on empty string.
authorAndrei Zmievski <andrei@php.net>
Tue, 2 May 2006 21:49:16 +0000 (21:49 +0000)
committerAndrei Zmievski <andrei@php.net>
Tue, 2 May 2006 21:49:16 +0000 (21:49 +0000)
ext/unicode/property.c

index c9ec9652e004a32a74d8375ca74231270ff0cb9e..61df1b7b3a9145917d386879a3e99caf57d61e08 100644 (file)
@@ -32,6 +32,10 @@ static void check_property_impl(INTERNAL_FUNCTION_PARAMETERS, prop_check_func_t
                return;
        }
 
+       if (str_len == 0) {
+               RETURN_FALSE;
+       }
+
        while (offset < str_len && result) {
                U16_NEXT(str, offset, str_len, ch);
                result = checker(ch);
@@ -40,9 +44,8 @@ static void check_property_impl(INTERNAL_FUNCTION_PARAMETERS, prop_check_func_t
        RETURN_BOOL(result);
 }
 
-/*
- * C/POSIX migration functinos
- */
+
+/* {{{ C/POSIX migration functions */
 
 PHP_FUNCTION(unicode_is_lower)
 {
@@ -104,6 +107,8 @@ PHP_FUNCTION(unicode_is_print)
        check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isprint);
 }
 
+/* }}} */
+
 
 /*
  * Local variables: