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:
parent
8f699c3212
commit
3507d9ca24
1 changed files with 3 additions and 1 deletions
4
esv.d
4
esv.d
|
@ -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()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue