summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-02-07 20:53:05 +0000
committerMarcus Boerger <helly@php.net>2003-02-07 20:53:05 +0000
commit598e82751d0dd9bd228167d262a09d26d6459f54 (patch)
tree251bce2da43511648599fead1988e6f92917b124 /sapi/cli/php_cli.c
parent957aeb83e391aee5812c8f6f123767dd3b7927c6 (diff)
downloadphp-git-598e82751d0dd9bd228167d262a09d26d6459f54.tar.gz
No more maximum line size for -R and -F
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 3149e46714..da433429e3 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -901,7 +901,7 @@ int main(int argc, char *argv[])
case PHP_MODE_PROCESS_STDIN:
{
- char input[4096];
+ char *input;
size_t len, index = 0;
php_stream_context *sc_in = php_stream_context_alloc();
php_stream *s_in = php_stream_open_wrapper_ex("php://stdin", "rb", 0, NULL, sc_in);
@@ -915,7 +915,7 @@ int main(int argc, char *argv[])
Z_LVAL_P(argi) = index;
INIT_PZVAL(argi);
zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(pval *), NULL);
- while (exit_status == SUCCESS && php_stream_gets(s_in, input, sizeof(input))) {
+ while (exit_status == SUCCESS && (input=php_stream_gets(s_in, NULL, 0)) != NULL) {
len = strlen(input);
while (len-- && (input[len]=='\n' || input[len]=='\r')) {
input[len] = '\0';
@@ -942,6 +942,7 @@ int main(int argc, char *argv[])
}
}
}
+ efree(input);
}
if (exec_end && zend_eval_string(exec_end, NULL, "Command line end code" TSRMLS_CC) == FAILURE) {
exit_status=254;