cvs: /php4/ext/pgsql pgsql.c
| From: | Zeev Suraski | Date: | Fri, 10 Sep 1999 02:55:29 +0000 |
| Subject: | cvs: /php4/ext/pgsql pgsql.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4296@lists.php.net to get a copy of this message | ||
zeev Thu Sep 9 22:55:29 1999 EDT
Modified files:
/php4/ext/pgsql pgsql.c
Log:
That should do the trick (untested)
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.19 php4/ext/pgsql/pgsql.c:1.20
--- php4/ext/pgsql/pgsql.c:1.19 Thu Sep 9 22:47:49 1999
+++ php4/ext/pgsql/pgsql.c Thu Sep 9 22:55:28 1999
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.19 1999/09/10 02:47:49 musone Exp $ */
+/* $Id: pgsql.c,v 1.20 1999/09/10 02:55:28 zeev Exp $ */
#include <stdlib.h>
@@ -916,29 +916,24 @@
for (i=0,num_fields=PQnfields(pgsql_result); i<num_fields; i++) {
element = PQgetvalue(pgsql_result,row->value.lval,i);
element_len = (element ? strlen(element) : 0);
- element = safe_estrndup(element,element_len);
if (element) {
char *data;
int data_len;
- int should_copy;
if (PG(magic_quotes_runtime)) {
data = php_addslashes(element,element_len,&data_len,0);
- should_copy = 0;
} else {
- data = element;
+ data = safe_estrndup(element,element_len);
data_len = element_len;
- should_copy = 1;
}
if (result_type & PGSQL_NUM) {
- add_index_stringl(return_value, i, data, data_len, should_copy);
- should_copy = 1;
+ add_index_stringl(return_value, i, data, data_len, 0);
}
if (result_type & PGSQL_ASSOC) {
field_name = PQfname(pgsql_result,i);
- add_assoc_stringl(return_value, field_name, data, data_len, should_copy);
+ add_assoc_stringl(return_value, field_name, data, data_len, 1);
}
} else {
/* NULL field, don't set it */