fix configpath

This commit is contained in:
David Rose 2004-06-04 19:03:24 +00:00
parent ae7aa58e8c
commit 5845c1e066

View File

@ -141,14 +141,19 @@ void ConfigTable::ReadConfigFile() {
int i = configpath.find_first_of(" "); int i = configpath.find_first_of(" ");
ConfigString stmp = configpath.substr(0, i); ConfigString stmp = configpath.substr(0, i);
if (ExecutionEnvironment::has_environment_variable(stmp)) { if (ExecutionEnvironment::has_environment_variable(stmp)) {
string next_path = ExecutionEnvironment::get_environment_variable(stmp); string path = ExecutionEnvironment::get_environment_variable(stmp);
while (!next_path.empty()) { size_t p = 0;
int j = next_path.find_first_of(" "); while (p < path.length()) {
Filename dir = Filename::from_os_specific(next_path.substr(0, j)); size_t q = path.find_first_of(" :", p);
config_search.append_directory(dir); if (q == string::npos) {
next_path.erase(0, j); config_search.append_directory(Filename::from_os_specific(path.substr(p)));
CropString(next_path); break;
}
if (q != p) {
config_search.append_directory(Filename::from_os_specific(path.substr(p, q - p)));
}
p = q + 1;
} }
} }
configpath.erase(0, i); configpath.erase(0, i);
@ -473,7 +478,8 @@ void ConfigTable::MicroConfig() {
if (microconfig_cat->is_spam()) if (microconfig_cat->is_spam())
microconfig_cat->spam() microconfig_cat->spam()
<< "got a microconfig configpath directive, " << "got a microconfig configpath directive, "
<< "adding '" << rest << "' to the configpath" << "adding '" << rest << "' to the configpath (now '"
<< configpath << "')"
<< endl; << endl;
} else { } else {
configpath = rest; configpath = rest;
@ -602,10 +608,9 @@ void ConfigTable::MicroConfig() {
<< "'" << endl; << "'" << endl;
} }
if (!cdir) { if (!cdir) {
ConfigPathDefault();
if (microconfig_cat->is_spam()) if (microconfig_cat->is_spam())
microconfig_cat->spam() << "no microconfig for configdir, " microconfig_cat->spam() << "no microconfig for configdir, "
<< "setting to default '" << configdir << "leaving empty: '" << configdir
<< "'" << endl; << "'" << endl;
} }
if (!ccmt) { if (!ccmt) {