CVS update: php3/functions

From: Date: Tue, 15 Sep 1998 18:13:48 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1126@lists.php.net to get a copy of this message
Date: Tuesday September 15, 1998 @ 14:13 Author: shane Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv6685/functions Modified Files: file.c unified_odbc.c Log Message: fix get_meta_tags fix odbc_connect to finally function right with both pconnect and connect Index: php3/functions/file.c diff -c php3/functions/file.c:1.179 php3/functions/file.c:1.180 *** php3/functions/file.c:1.179 Thu Sep 3 11:44:27 1998 --- php3/functions/file.c Tue Sep 15 14:13:46 1998 *************** *** 26,32 **** | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: file.c,v 1.179 1998/09/03 15:44:27 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 26,32 ---- | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: file.c,v 1.180 1998/09/15 18:13:46 shane Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 210,218 **** }; /* get_meta_tags(string filename); ! extracts all meta tags from a file and creates variables from them (prefixed with meta_) The meta tag must have a name and content attribute, otherwise it will be skipped. - The variable type created is always a string. The function stops parsing at the closing head tag. */ void php3_get_meta_tags(INTERNAL_FUNCTION_PARAMETERS) { --- 210,217 ---- }; /* get_meta_tags(string filename); ! extracts all meta tags from a file and returns an array The meta tag must have a name and content attribute, otherwise it will be skipped. The function stops parsing at the closing head tag. */ void php3_get_meta_tags(INTERNAL_FUNCTION_PARAMETERS) { *************** *** 221,227 **** char buf[8192]; int use_include_path = 0; int issock=0, socketd=0; ! int len,var_namelen; char var_name[50],*val=NULL,*tmp,*end,*slashed; TLS_VARS; --- 220,226 ---- char buf[8192]; int use_include_path = 0; int issock=0, socketd=0; ! int len,var_namelen, i=0; char var_name[50],*val=NULL,*tmp,*end,*slashed; TLS_VARS; *************** *** 253,258 **** --- 252,269 ---- RETURN_FALSE; } + if (array_init(return_value)==FAILURE) { + if (issock) { + #if WIN32|WINNT + closesocket(socketd); + #else + close(socketd); + #endif + } else { + fclose(fp); + } + RETURN_FALSE; + } /* Now loop through the file and do the magic quotes thing if needed */ memset(buf,0,8191); while((issock?SOCK_FGETS(buf,8191,socketd):(int)fgets(buf,8191,fp)) *************** *** 268,274 **** if(end) { unsigned char *c; *end='\0'; ! snprintf(var_name,50,"meta_%s",tmp); *end='"'; c = var_name; --- 279,285 ---- if(end) { unsigned char *c; *end='\0'; ! snprintf(var_name,50,"%s",tmp); *end='"'; c = var_name; *************** *** 308,320 **** } } if(*var_name && val) { if (php3_ini.magic_quotes_runtime) { slashed = _php3_addslashes(val,0,&len,0); } else { slashed = estrndup(val,strlen(val)); } ! SET_VAR_STRING(var_name,slashed); efree(val); } } } --- 319,335 ---- } } if(*var_name && val) { + pval *pval_ptr; if (php3_ini.magic_quotes_runtime) { slashed = _php3_addslashes(val,0,&len,0); } else { slashed = estrndup(val,strlen(val)); } ! add_get_index_string(return_value, i, slashed, &pval_ptr, 0); ! _php3_hash_pointer_update(return_value->value.ht, var_name, strlen(var_name)+1, pval_ptr); ! /* SET_VAR_STRING(var_name,slashed); */ efree(val); + i++; } } } Index: php3/functions/unified_odbc.c diff -c php3/functions/unified_odbc.c:1.79 php3/functions/unified_odbc.c:1.80 *** php3/functions/unified_odbc.c:1.79 Mon Sep 14 12:54:17 1998 --- php3/functions/unified_odbc.c Tue Sep 15 14:13:46 1998 *************** *** 1634,1643 **** * no matter if it is to be persistent or not */ ! if (_php3_hash_find(plist, hashed_details, hashed_len + 1, ! (void **) &index_ptr) == FAILURE && ! (!persistent && _php3_hash_find(list, hashed_details, hashed_len + 1, ! (void **) &index_ptr) == FAILURE)) { /* the link is not in the persistent list */ list_entry new_le, new_index_ptr; --- 1634,1643 ---- * no matter if it is to be persistent or not */ ! if ((persistent || _php3_hash_find(list, hashed_details, hashed_len + 1, ! (void **) &index_ptr) == FAILURE) && ! _php3_hash_find(plist, hashed_details, hashed_len + 1, ! (void **) &index_ptr) == FAILURE) { /* the link is not in the persistent list */ list_entry new_le, new_index_ptr; -- 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 (#1126) next »