summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-06-27 22:13:41 +0000
committerFelipe Pena <felipe@php.net>2010-06-27 22:13:41 +0000
commitced29dd7065818fbf27d01f50fc3d2792e267d50 (patch)
tree1697058593b33466cb6df9438a03110812526d69 /sapi/cli/php_cli.c
parent9b07568c437b081231dcf2b9857c85fa13edfe67 (diff)
downloadphp-git-ced29dd7065818fbf27d01f50fc3d2792e267d50.tar.gz
- Improved initialization
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index cf2d2d5582..d303f80756 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -630,7 +630,6 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
CG(shebang_len) = ftell(file_handle->handle.fp);
*lineno = 2;
} else {
- CG(shebang_len) = 0;
rewind(file_handle->handle.fp);
}
@@ -1060,6 +1059,7 @@ int main(int argc, char *argv[])
script_file=argv[php_optind];
php_optind++;
}
+ CG(shebang_len) = 0;
if (script_file) {
if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
goto err;
@@ -1268,6 +1268,7 @@ int main(int argc, char *argv[])
exit_status=254;
}
} else {
+ CG(shebang_len) = 0;
if (script_file) {
if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
exit_status = 1;