sometimes there are no arg 0

This commit is contained in:
Adam D. Ruppe 2022-11-05 10:55:55 -04:00
parent 6f03281044
commit f6067f7b35
1 changed files with 2 additions and 2 deletions

4
cgi.d
View File

@ -957,7 +957,7 @@ class Cgi {
{ {
import core.runtime; import core.runtime;
auto sfn = getenv("SCRIPT_FILENAME"); auto sfn = getenv("SCRIPT_FILENAME");
scriptFileName = sfn.length ? sfn : Runtime.args[0]; scriptFileName = sfn.length ? sfn : (Runtime.args.length ? Runtime.args[0] : null);
} }
bool iis = false; bool iis = false;
@ -1751,7 +1751,7 @@ class Cgi {
{ {
import core.runtime; import core.runtime;
scriptFileName = Runtime.args[0]; scriptFileName = Runtime.args.length ? Runtime.args[0] : null;
} }