mirror of https://github.com/BOINC/boinc.git
client: fix minor prefs parsing bug
If we parse for a target venue, and it's present, and mod_time/source_project/source_scheduler appear after the venue, we were failing to parse them.
This commit is contained in:
parent
ab1085b25f
commit
2b3c19ec0a
|
@ -408,15 +408,28 @@ int GLOBAL_PREFS::parse_override(
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
if (in_venue) {
|
||||
if (xp.match_tag("/venue")) {
|
||||
if (in_correct_venue) {
|
||||
return 0;
|
||||
} else {
|
||||
in_venue = false;
|
||||
// parse these first; they're independent of venue
|
||||
//
|
||||
if (xp.parse_str("source_project", source_project, sizeof(source_project))) {
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_str("source_scheduler", source_scheduler, sizeof(source_scheduler))) {
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_double("mod_time", mod_time)) {
|
||||
double now = dtime();
|
||||
if (mod_time > now) {
|
||||
mod_time = now;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (in_venue) {
|
||||
if (xp.match_tag("/venue")) {
|
||||
in_venue = false;
|
||||
continue;
|
||||
} else {
|
||||
// we're in a venue but not the right one; skip tag
|
||||
//
|
||||
if (!in_correct_venue) continue;
|
||||
}
|
||||
} else {
|
||||
|
@ -434,17 +447,11 @@ int GLOBAL_PREFS::parse_override(
|
|||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (xp.parse_str("source_project", source_project, sizeof(source_project))) continue;
|
||||
if (xp.parse_str("source_scheduler", source_scheduler, sizeof(source_scheduler))) {
|
||||
if (found_venue) {
|
||||
// we already found and parsed the target venue;
|
||||
// skip subsequent prefs tags not in a venue
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_double("mod_time", mod_time)) {
|
||||
double now = dtime();
|
||||
if (mod_time > now) {
|
||||
mod_time = now;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_double("battery_charge_min_pct", battery_charge_min_pct)) {
|
||||
mask.battery_charge_min_pct = true;
|
||||
|
|
Loading…
Reference in New Issue