fix #H4060 - sysconf is re-read if no config file

Config file handling remembers the name of the last config file
read in order for options processing to use it in messages, but
it was also reused as default config file name if user-supplied
config file name failed access() test.  So the SYSCF file became
the default user config file after it was used.  The config file
handling was a real mess.

This patch fixes it for Unix but there is a lot of scope for
typos in the changes for other platforms.  Testing is needed.
This commit is contained in:
PatR
2016-06-12 17:52:12 -07:00
parent 4e12bb6144
commit 4ff8d8ac7e
5 changed files with 80 additions and 67 deletions

View File

@@ -55,7 +55,7 @@ void ClearCol(struct Window *w);
void
EditColor()
{
extern const char *configfile;
extern char configfile[];
int i, done = 0, okay = 0;
long code, qual, class;
register struct Gadget *gd, *dgad;