]> granicus.if.org Git - php/commitdiff
Fix the line numbering when the 1st line in the script is #!.
authorIlia Alshanetsky <iliaa@php.net>
Sat, 11 Jan 2003 00:20:50 +0000 (00:20 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 11 Jan 2003 00:20:50 +0000 (00:20 +0000)
sapi/cli/php_cli.c

index 412180b577137ee330bb9dbb9a5ea7e8f6428005..43d6049854a035d71992c20c224c144154699bbf 100644 (file)
@@ -414,6 +414,7 @@ int main(int argc, char *argv[])
        zend_llist global_vars;
        int interactive=0;
        int module_started = 0;
+       int lineno = 0;
        char *exec_direct=NULL;
        char *param_error=NULL;
 /* end of temporary locals */
@@ -702,7 +703,7 @@ int main(int argc, char *argv[])
                                                fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
                                        }
                                }
-                               CG(start_lineno) = 2;
+                               lineno = 2;
                        } else {
                                rewind(file_handle.handle.fp);
                        }
@@ -733,6 +734,7 @@ int main(int argc, char *argv[])
                        PUTS("Could not startup.\n");
                        goto err;
                }
+               CG(start_lineno) = lineno;
                *arg_excp = arg_free; /* reconstuct argv */
                if (no_headers) {
                        SG(headers_sent) = 1;