cvs: /php4/sapi/cgi cgi_main.c
| From: | Andi Gutmans | Date: | Fri, 05 May 2000 07:21:48 +0000 |
| Subject: | cvs: /php4/sapi/cgi cgi_main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14509@lists.php.net to get a copy of this message | ||
andi Fri May 5 00:21:48 2000 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
- Fix problem with sapi_globals being used before it is initialized.
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.41 php4/sapi/cgi/cgi_main.c:1.42
--- php4/sapi/cgi/cgi_main.c:1.41 Fri May 5 00:18:48 2000
+++ php4/sapi/cgi/cgi_main.c Fri May 5 00:21:48 2000
@@ -426,6 +426,19 @@
#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 @@
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 */