]> granicus.if.org Git - php/commitdiff
use argv[1] if it's given, thanks to Bob Denny <rdenny@dc3.com>
authorDaniel Beulshausen <dbeu@php.net>
Fri, 3 Nov 2000 09:55:54 +0000 (09:55 +0000)
committerDaniel Beulshausen <dbeu@php.net>
Fri, 3 Nov 2000 09:55:54 +0000 (09:55 +0000)
sapi/cgi/cgi_main.c

index c5928a24d6b312e070d709cc071a01d5431dcf54..bccf8187150cadd3682ad478d81a0fb18e201d06 100644 (file)
@@ -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);