diff options
| author | Andi Gutmans <andi@php.net> | 2000-05-05 07:21:48 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2000-05-05 07:21:48 +0000 |
| commit | 0d194ec80b826110ee682fbff94820c0b8a2bddf (patch) | |
| tree | bd8dc05c08eca4546ad3e00ef48ee7768315f476 /sapi/cgi | |
| parent | 198537b70f9592245b609bbb5a33c9231e25dcf8 (diff) | |
| download | php-git-0d194ec80b826110ee682fbff94820c0b8a2bddf.tar.gz | |
- Fix problem with sapi_globals being used before it is initialized.
Diffstat (limited to 'sapi/cgi')
| -rw-r--r-- | sapi/cgi/cgi_main.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 96d844a1a0..8ff2288aaf 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -426,6 +426,19 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine #endif /* FORCE_CGI_REDIRECT */ } + if (php_module_startup(&sapi_module)==FAILURE) { + return FAILURE; + } +#ifdef ZTS + compiler_globals = ts_resource(compiler_globals_id); + executor_globals = ts_resource(executor_globals_id); + core_globals = ts_resource(core_globals_id); + sapi_globals = ts_resource(sapi_globals_id); + if (setjmp(EG(bailout))!=0) { + return -1; + } +#endif + if (!cgi) { while ((c=ap_php_getopt(argc, argv, "c:d:z:g:qvisnaeh?vf:"))!=-1) { switch (c) { @@ -443,20 +456,6 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine ap_php_optind = orig_optind; ap_php_optarg = orig_optarg; } - - - if (php_module_startup(&sapi_module)==FAILURE) { - return FAILURE; - } -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); - sapi_globals = ts_resource(sapi_globals_id); - if (setjmp(EG(bailout))!=0) { - return -1; - } -#endif init_request_info(SLS_C); SG(server_context) = (void *) 1; /* avoid server_context==NULL checks */ |
