cvs: php4 /sapi/cgi/ cgi_main.c

[email protected] ("Hartmut Holzgraefe")
Newsgroups php.version4
Message-ID <cvshholzgra959035759@cvsserver>
hholzgra		Tue May 23 00:49:19 2000 EDT

  Modified files:
    /php4/sapi/cgi	cgi_main.c 
  Log:
  -i, -v, -h and -? execution pathes didn't flush the output buffer
  on exit, resultiong in no output at all when "output-buffering=On"
  ( BUG id#3420 )
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.43 php4/sapi/cgi/cgi_main.c:1.44
--- php4/sapi/cgi/cgi_main.c:1.43	Thu May 18 17:34:40 2000
+++ php4/sapi/cgi/cgi_main.c	Tue May 23 00:49:18 2000
@@ -446,9 +446,11 @@
 					php_ini_path = strdup(ap_php_optarg);		/* intentional leak */
 					break;
 				case '?':
+					no_headers = 1;
 					php_output_startup();
 					SG(headers_sent) = 1;
 					php_cgi_usage(argv[0]);
+					php_end_ob_buffering(1);
 					exit(1);
 					break;
 			}
@@ -487,6 +489,7 @@
 					no_headers = 1;
 					break;
 				case 'v':
+					no_headers = 1;
 					if (!cgi_started) {
 						if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
 							php_module_shutdown();
@@ -497,6 +500,7 @@
 						SG(headers_sent) = 1;
 					}
 					php_printf("%s\n", PHP_VERSION);
+					php_end_ob_buffering(1);
 					exit(1);
 					break;
 				case 'i':
@@ -531,10 +535,12 @@
 					CG(extended_info) = 1;
 					break;
 				case 'h':
-				case '?':
+			        case '?':
+				        no_headers = 1;  
 					php_output_startup();
 					SG(headers_sent) = 1;
 					php_cgi_usage(argv[0]);
+					php_end_ob_buffering(1);
 					exit(1);
 					break;
 				case 'd':
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.