esv: initialise cFlag to null

Before this change a user could pass an empty string as the argument
to -C and it would go undetected.
This commit is contained in:
Jeremy Baxter 2024-06-26 09:45:52 +12:00
parent 8f699c3212
commit 3507d9ca24

4
esv.d
View file

@ -58,6 +58,8 @@ main(string[] args)
sharedInit(args); sharedInit(args);
cFlag = null;
/* Parse command-line options */ /* Parse command-line options */
try { try {
import std.getopt : config; import std.getopt : config;
@ -106,7 +108,7 @@ config:
configPath = environment.get(cf.configEnv, cf.configPath) configPath = environment.get(cf.configEnv, cf.configPath)
.expandTilde(); .expandTilde();
try { try {
if (cFlag != "") { /* if -c was given */ if (cFlag) {
configPath = cFlag.expandTilde(); configPath = cFlag.expandTilde();
} else { } else {
if (!configPath.exists()) { if (!configPath.exists()) {