From 3507d9ca242741487f65dbef2d78fc38a0dee641 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Wed, 26 Jun 2024 09:45:52 +1200 Subject: [PATCH] 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. --- esv.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esv.d b/esv.d index 25683e2..186902f 100644 --- a/esv.d +++ b/esv.d @@ -58,6 +58,8 @@ main(string[] args) sharedInit(args); + cFlag = null; + /* Parse command-line options */ try { import std.getopt : config; @@ -106,7 +108,7 @@ config: configPath = environment.get(cf.configEnv, cf.configPath) .expandTilde(); try { - if (cFlag != "") { /* if -c was given */ + if (cFlag) { configPath = cFlag.expandTilde(); } else { if (!configPath.exists()) {