[PHP-dev 190] PHP4_namazu-2.1.0 patch

Youichi Iwakiri php-dev@php.gr.jp
Wed, 02 Jan 2002 21:45:57 +0900


いわきりです

クリスマスプレゼントありがとう御座いました > 塚田さん
一部不具合がありましたのでpatchを送ります。

#元のソースの可読性が悪かった事が過分にありますが ...


--- php_namazu.c	Mon Dec  3 22:50:38 2001
+++ ../php-4.1.0/ext/namazu/php_namazu.c	Wed Jan  2 20:50:12 2002
@@ -745,16 +745,16 @@
 
 	limit = nmzres->hlist.num;
 	offset = 0;
-	if (ZEND_NUM_ARGS() >= 3) {
-		convert_to_long_ex(arg_limit);
-		if (limit > Z_LVAL_PP(arg_limit)) {
-			limit = Z_LVAL_PP(arg_limit);
-		}
-	}
 	if (ZEND_NUM_ARGS() == 4) {
 		convert_to_long_ex(arg_offset);
 		if (limit > Z_LVAL_PP(arg_offset)) {
 			offset = Z_LVAL_PP(arg_offset);
+		}
+	}
+	if (ZEND_NUM_ARGS() >= 3) {
+		convert_to_long_ex(arg_limit);
+		if (limit > offset + Z_LVAL_PP(arg_limit)) {
+			limit = offset + Z_LVAL_PP(arg_limit);
 		}
 	}