Skip to content

Commit

Permalink
Merge pull request #5704 from BOINC/dpa_prefs9
Browse files Browse the repository at this point in the history
client: fix minor prefs parsing bug
  • Loading branch information
AenBleidd authored Jul 24, 2024
2 parents 0d8a2e4 + 2b3c19e commit 5d1d4c5
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions lib/prefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,28 @@ int GLOBAL_PREFS::parse_override(
}
return 0;
}
// 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")) {
if (in_correct_venue) {
return 0;
} else {
in_venue = false;
continue;
}
in_venue = false;
continue;
} else {
// we're in a venue but not the right one; skip tag
//
if (!in_correct_venue) continue;
}
} else {
Expand All @@ -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))) {
continue;
}
if (xp.parse_double("mod_time", mod_time)) {
double now = dtime();
if (mod_time > now) {
mod_time = now;
if (found_venue) {
// we already found and parsed the target venue;
// skip subsequent prefs tags not in a venue
continue;
}
continue;
}
if (xp.parse_double("battery_charge_min_pct", battery_charge_min_pct)) {
mask.battery_charge_min_pct = true;
Expand Down

0 comments on commit 5d1d4c5

Please sign in to comment.