Changed sequence of config search, thanks to Alexey Vissarionov 2:5020/545

This commit is contained in:
Stas Degteff
2008-05-28 23:21:46 +00:00
parent a9e6100dd9
commit e50d2f728e
4 changed files with 26 additions and 7 deletions

View File

@@ -100,19 +100,19 @@
#ifndef CFGUSERPATH1
#ifdef __UNIX__
#define CFGUSERPATH1 "~/.golded/" /* Trailing slash: this is directory */
#define CFGUSERPATH1 "~/fido/etc/" /* Trailing slash: this is directory */
#endif
#endif
#ifndef CFGUSERPATH2
#ifdef __UNIX__
#define CFGUSERPATH2 "~/"
#define CFGUSERPATH2 "~/ftn/etc/" /* Trailing slash: this is directory */
#endif
#endif
#ifndef CFGPATH
#ifdef __UNIX__
#define CFGPATH "/usr/local/etc/"
#define CFGPATH "~/.golded/" /* Trailing slash: this is directory */
#endif
#endif

View File

@@ -683,15 +683,17 @@ void Initialize(int argc, char* argv[]) {
found = FindCfg(cmdlinecfg);
}
#ifndef __UNIX__
// Get it where the the binary file is
if(not found) {
extractdirname(cmdlinecfg, argv[0]);
found = FindCfg(cmdlinecfg);
// If we still could not find config name...
if(not found)
strcat(cmdlinecfg, GEDCFG);
}
#endif
// If we still could not find config name...
if(not found)
strcat(cmdlinecfg, GEDCFG);
}
extractdirname(CFG->goldpath, cmdlinecfg);
truepathtmp = CFG->goldpath;