CVS update: php3/functions

From: Date: Sun, 18 Apr 1999 00:09:51 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5115@lists.php.net to get a copy of this message
Date: Saturday April 17, 1999 @ 20:09 Author: sas Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv22974/functions Modified Files: string.c Log Message: don't fpe if both strings are empty strings Index: php3/functions/string.c diff -c php3/functions/string.c:1.183 php3/functions/string.c:1.184 *** php3/functions/string.c:1.183 Tue Apr 13 10:28:46 1999 --- php3/functions/string.c Sat Apr 17 20:09:50 1999 *************** *** 30,36 **** */ ! /* $Id: string.c,v 1.183 1999/04/13 14:28:46 fmk Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 30,36 ---- */ ! /* $Id: string.c,v 1.184 1999/04/18 00:09:50 sas Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 1145,1156 **** convert_to_string(t1); convert_to_string(t2); ! sim = _php3_similar_char(t1->value.str.val, t1->value.str.len, t2->value.str.val, t2->value.str.len); if (ac > 2) { - convert_to_double(percent); percent->value.dval = sim * 200.0 / (t1->value.str.len + t2->value.str.len); } --- 1145,1164 ---- convert_to_string(t1); convert_to_string(t2); ! if(ac > 2) { ! convert_to_double(percent); ! } ! ! if((t1->value.str.len + t2->value.str.len) == 0) { ! if(ac > 2) ! percent->value.dval = 0; ! RETURN_LONG(0); ! } ! sim = _php3_similar_char(t1->value.str.val, t1->value.str.len, t2->value.str.val, t2->value.str.len); if (ac > 2) { percent->value.dval = sim * 200.0 / (t1->value.str.len + t2->value.str.len); } -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5115) next »