Fix a bug introduced by DEFAULTS feature. When the config file
doesn't exist, we make a directory and then say "oops, that file isn't there" leaving the directory behind. Add a stat for the config file so that we detect this before making the directory. This is semi-lame, but less lame than having this bug.
This commit is contained in:
parent
76d5b2344b
commit
399365b45a
@ -150,6 +150,8 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
|
||||
PREFIX = *argv;
|
||||
if (stat(PREFIX, &buf) != 0 || !S_ISREG(buf.st_mode))
|
||||
err(2, "%s", PREFIX);
|
||||
if (freopen("DEFAULTS", "r", stdin) != NULL) {
|
||||
found_defaults = 1;
|
||||
yyfile = "DEFAULTS";
|
||||
|
Loading…
Reference in New Issue
Block a user