CVS update: php3/functions

From: Date: Mon, 05 Apr 1999 21:46:27 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4943@lists.php.net to get a copy of this message
Date: Monday April 5, 1999 @ 17:46 Author: sas Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv4356/functions Modified Files: reg.c Log Message: Let sql_regcase only convert letters into bracket expressions. #1294 Index: php3/functions/reg.c diff -c php3/functions/reg.c:1.98 php3/functions/reg.c:1.99 *** php3/functions/reg.c:1.98 Sun Feb 28 12:25:57 1999 --- php3/functions/reg.c Mon Apr 5 17:46:27 1999 *************** *** 28,34 **** | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ ! /* $Id: reg.c,v 1.98 1999/02/28 17:25:57 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 28,34 ---- | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ ! /* $Id: reg.c,v 1.99 1999/04/05 21:46:27 sas Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 600,606 **** { pval *string; char *tmp; ! register int i; if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &string)==FAILURE) { WRONG_PARAM_COUNT; --- 600,607 ---- { pval *string; char *tmp; ! unsigned char c; ! register int i, j; if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &string)==FAILURE) { WRONG_PARAM_COUNT; *************** *** 610,626 **** tmp = (char *) emalloc(string->value.str.len*4+1); ! for (i=0; i<string->value.str.len; i++) { ! tmp[i*4] = '['; ! tmp[i*4+1]=toupper((unsigned char)string->value.str.val[i]); ! tmp[i*4+2]=tolower((unsigned char)string->value.str.val[i]); ! tmp[i*4+3]=']'; ! } ! tmp[string->value.str.len*4]=0; ! ! return_value->value.str.val = tmp; ! return_value->value.str.len = string->value.str.len*4; ! return_value->type = IS_STRING; } /* }}} */ --- 611,632 ---- tmp = (char *) emalloc(string->value.str.len*4+1); ! for (i=j=0; i<string->value.str.len; i++) { ! c = (unsigned char) string->value.str.val[i]; ! if(isalpha(c)) { ! tmp[j++] = '['; ! tmp[j++] = toupper(c); ! tmp[j++] = tolower(c); ! tmp[j++] = ']'; ! } else { ! tmp[j++] = c; ! } ! } ! tmp[j]=0; ! ! tmp = erealloc(tmp, j + 1); ! ! RETVAL_STRINGL(tmp, j, 0); } /* }}} */ -- 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 (#4943) next »