From: Daniel Beulshausen Date: Fri, 3 Nov 2000 09:55:54 +0000 (+0000) Subject: use argv[1] if it's given, thanks to Bob Denny X-Git-Tag: php-4.0.4RC3~342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e48df787a3deb0144e35172379a708f933915a4;p=php use argv[1] if it's given, thanks to Bob Denny --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index c5928a24d6..bccf818715 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -702,10 +702,14 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine } if (cgi && !file_handle.handle.fp) { - PUTS("No input file specified.\n"); - php_request_shutdown((void *) 0); - php_module_shutdown(); - return FAILURE; + file_handle.handle.fp = V_FOPEN(argv0, "rb"); + if(!file_handle.handle.fp) { + PUTS("No input file specified.\n"); + php_request_shutdown((void *) 0); + php_module_shutdown(); + return FAILURE; + } + file_handle.filename = argv0; } else if (file_handle.handle.fp && file_handle.handle.fp!=stdin) { /* #!php support */ c = fgetc(file_handle.handle.fp);