Re: ZSTR and NULL problems again
| From: | Nuno Lopes | Date: | Sat, 29 Apr 2006 11:35:55 +0000 |
| Subject: | Re: ZSTR and NULL problems again | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23028@lists.php.net to get a copy of this message | ||
Here is a diff to fix a couple of missing ZSTR macros.
----- Original Message ----- From: "Hannes Magnusson" <hannes.magnusson@gmail.com>
To: "Frank M. Kromann" <frank@kromann.info>
Cc: "Sara Golemon" <pollita@php.net>; "Wez Furlong" <kingwez@gmail.com>; "Andrei Zmievski" <andrei@gravitonic.com>; <internals@lists.php.net>
Sent: Saturday, April 29, 2006 12:17 PM
Subject: Re: [PHP-DEV] ZSTR and NULL problems again
Hi Frank
I have now removed the ZSTR() macros from the stream macros. Andrei will you please test that it compiles now? http://bugs.php.net/bug.php?id=37241
Index: ext/pdo/pdo_dbh.c =================================================================== RCS file: /repository/php-src/ext/pdo/pdo_dbh.c,v retrieving revision 1.127 diff -u -r1.127 pdo_dbh.c --- ext/pdo/pdo_dbh.c 23 Mar 2006 19:03:30 -0000 1.127 +++ ext/pdo/pdo_dbh.c 29 Apr 2006 11:34:01 -0000 @@ -189,7 +189,7 @@ stream = php_stream_open_wrapper(uri, "rb", REPORT_ERRORS, NULL); if (stream) { - dsn = php_stream_get_line(stream, buf, buflen, NULL); + dsn = php_stream_get_line(stream, ZSTR(buf), buflen, NULL); php_stream_close(stream); } return dsn; Index: ext/standard/exec.c =================================================================== RCS file: /repository/php-src/ext/standard/exec.c,v retrieving revision 1.118 diff -u -r1.118 exec.c --- ext/standard/exec.c 8 Mar 2006 00:43:28 -0000 1.118 +++ ext/standard/exec.c 29 Apr 2006 11:34:03 -0000 @@ -92,7 +92,7 @@ if (type != 3) { b = buf; - while (php_stream_get_line(stream, b, EXEC_INPUT_BUF, &bufl)) { + while (php_stream_get_line(stream, ZSTR(b), EXEC_INPUT_BUF, &bufl)) { /* no new line found, let's read some more */ if (b[bufl - 1] != '\n' && !php_stream_eof(stream)) { if (buflen < (bufl + (b - buf) + EXEC_INPUT_BUF)) { Index: ext/standard/ftp_fopen_wrapper.c =================================================================== RCS file: /repository/php-src/ext/standard/ftp_fopen_wrapper.c,v retrieving revision 1.90 diff -u -r1.90 ftp_fopen_wrapper.c --- ext/standard/ftp_fopen_wrapper.c 20 Mar 2006 14:10:23 -0000 1.90 +++ ext/standard/ftp_fopen_wrapper.c 29 Apr 2006 11:34:03 -0000 @@ -71,7 +71,7 @@ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) { - while (php_stream_gets(stream, buffer, buffer_size-1) && + while (php_stream_gets(stream, ZSTR(buffer), buffer_size-1) && !(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) && isdigit((int) buffer[2]) && buffer[3] == ' ')); return strtol(buffer, NULL, 10); @@ -595,7 +595,7 @@ return 0; } - if (!php_stream_get_line(innerstream, ent->d_name, sizeof(ent->d_name), &tmp_len)) { + if (!php_stream_get_line(innerstream, ZSTR(ent->d_name), sizeof(ent->d_name), &tmp_len)) { return 0; } Index: ext/zlib/zlib.c =================================================================== RCS file: /repository/php-src/ext/zlib/zlib.c,v retrieving revision 1.192 diff -u -r1.192 zlib.c --- ext/zlib/zlib.c 8 Mar 2006 14:41:45 -0000 1.192 +++ ext/zlib/zlib.c 29 Apr 2006 11:34:04 -0000 @@ -305,7 +305,7 @@ /* Now loop through the file and do the magic quotes thing if needed */ memset(buf,0,sizeof(buf)); - while (php_stream_gets(stream, buf, sizeof(buf) - 1) != NULL) { + while (php_stream_gets(stream, ZSTR(buf), sizeof(buf) - 1) != NULL) { add_index_string(return_value, i++, buf, 1); } php_stream_close(stream); Index: sapi/cli/php_cli.c =================================================================== RCS file: /repository/php-src/sapi/cli/php_cli.c,v retrieving revision 1.151 diff -u -r1.151 php_cli.c --- sapi/cli/php_cli.c 22 Apr 2006 10:39:31 -0000 1.151 +++ sapi/cli/php_cli.c 29 Apr 2006 11:34:04 -0000 @@ -1146,7 +1146,7 @@ Z_LVAL_P(argi) = index; INIT_PZVAL(argi); zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL); - while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { + while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL_ZSTR, 0)) != NULL) { len = strlen(input); while (len-- && (input[len]=='\n' || input[len]=='\r')) { input[len] = '\0';