CVS update: php4/ext/standard
| From: | thies | Date: | Wed, 09 Jun 1999 19:47:06 +0000 |
| Subject: | CVS update: php4/ext/standard | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1424@lists.php.net to get a copy of this message | ||
Date: Wednesday June 9, 1999 @ 15:47
Author: thies
Update of /repository/php4/ext/standard
In directory php:/tmp/cvs-serv31288/ext/standard
Modified Files:
string.c
Log Message:
oci8 to 3.0.9
implode works!
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.15 php4/ext/standard/string.c:1.16
--- php4/ext/standard/string.c:1.15 Sun May 16 07:32:51 1999
+++ php4/ext/standard/string.c Wed Jun 9 15:47:06 1999
@@ -30,7 +30,7 @@
*/
-/* $Id: string.c,v 1.15 1999/05/16 11:32:51 sas Exp $ */
+/* $Id: string.c,v 1.16 1999/06/09 19:47:06 thies Exp $ */
#include <stdio.h>
#include "php.h"
@@ -306,7 +306,7 @@
Join array elements placing glue string between items and return one string */
PHP_FUNCTION(implode)
{
- pval *arg1, *arg2, *delim, *tmp, *arr;
+ pval *arg1, *arg2, *delim, **tmp, *arr;
int len = 0, count = 0;
if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
@@ -329,9 +329,9 @@
/* convert everything to strings, and calculate length */
_php3_hash_internal_pointer_reset(arr->value.ht);
while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
- convert_to_string(tmp);
- if (tmp->type == IS_STRING) {
- len += tmp->value.str.len;
+ convert_to_string(*tmp);
+ if ((*tmp)->type == IS_STRING) {
+ len += (*tmp)->value.str.len;
if (count>0) {
len += delim->value.str.len;
}
@@ -346,9 +346,9 @@
return_value->value.str.val[len] = '\0';
_php3_hash_internal_pointer_reset(arr->value.ht);
while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
- if (tmp->type == IS_STRING) {
+ if ((*tmp)->type == IS_STRING) {
count--;
- strcat(return_value->value.str.val, tmp->value.str.val);
+ strcat(return_value->value.str.val, (*tmp)->value.str.val);
if (count > 0) {
strcat(return_value->value.str.val, delim->value.str.val);
}
@@ -356,6 +356,8 @@
_php3_hash_move_forward(arr->value.ht);
}
return_value->type = IS_STRING;
+ return_value->refcount = 1;
+ return_value->is_ref = 0;
return_value->value.str.len = len;
}
/* }}} */