felipe                                   Sun, 27 Jun 2010 22:13:41 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=300790

Log:
- Improved initialization

Changed paths:
    U   php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c
    U   php/php-src/branches/PHP_5_3/sapi/cli/php_cli.c
    U   php/php-src/trunk/sapi/cgi/cgi_main.c
    U   php/php-src/trunk/sapi/cli/php_cli.c

Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c    2010-06-27 21:46:16 UTC 
(rev 300789)
+++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c    2010-06-27 22:13:41 UTC 
(rev 300790)
@@ -2084,6 +2084,7 @@
                                }
                        }

+                       CG(shebang_len) = 0;
                        if (CGIG(check_shebang_line) && file_handle.handle.fp 
&& (file_handle.handle.fp != stdin)) {
                                /* #!php support */
                                c = fgetc(file_handle.handle.fp);
@@ -2101,7 +2102,6 @@
                                        CG(shebang_len) = 
ftell(file_handle.handle.fp);
                                        CG(start_lineno) = 2;
                                } else {
-                                       CG(shebang_len) = 0;
                                        rewind(file_handle.handle.fp);
                                }
                        }

Modified: php/php-src/branches/PHP_5_3/sapi/cli/php_cli.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/cli/php_cli.c     2010-06-27 21:46:16 UTC 
(rev 300789)
+++ php/php-src/branches/PHP_5_3/sapi/cli/php_cli.c     2010-06-27 22:13:41 UTC 
(rev 300790)
@@ -630,7 +630,6 @@
                CG(shebang_len) = ftell(file_handle->handle.fp);
                *lineno = 2;
        } else {
-               CG(shebang_len) = 0;
                rewind(file_handle->handle.fp);
        }

@@ -1060,6 +1059,7 @@
                        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 @@
                                                        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;

Modified: php/php-src/trunk/sapi/cgi/cgi_main.c
===================================================================
--- php/php-src/trunk/sapi/cgi/cgi_main.c       2010-06-27 21:46:16 UTC (rev 
300789)
+++ php/php-src/trunk/sapi/cgi/cgi_main.c       2010-06-27 22:13:41 UTC (rev 
300790)
@@ -2079,6 +2079,7 @@
                                }
                        }

+                       CG(shebang_len) = 0;
                        if (CGIG(check_shebang_line) && file_handle.handle.fp 
&& (file_handle.handle.fp != stdin)) {
                                /* #!php support */
                                c = fgetc(file_handle.handle.fp);
@@ -2096,7 +2097,6 @@
                                        CG(shebang_len) = 
ftell(file_handle.handle.fp);
                                        CG(start_lineno) = 2;
                                } else {
-                                       CG(shebang_len) = 0;
                                        rewind(file_handle.handle.fp);
                                }
                        }

Modified: php/php-src/trunk/sapi/cli/php_cli.c
===================================================================
--- php/php-src/trunk/sapi/cli/php_cli.c        2010-06-27 21:46:16 UTC (rev 
300789)
+++ php/php-src/trunk/sapi/cli/php_cli.c        2010-06-27 22:13:41 UTC (rev 
300790)
@@ -655,7 +655,6 @@
                CG(shebang_len) = ftell(file_handle->handle.fp);
                *lineno = 2;
        } else {
-               CG(shebang_len) = 0;
                rewind(file_handle->handle.fp);
        }

@@ -1089,6 +1088,7 @@
                        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;
@@ -1328,6 +1328,7 @@
                                                        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;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to