* bug fix

This commit is contained in:
Scott Powell 2026-04-17 14:38:03 +10:00
parent d3ba89c8bb
commit 77d02e844f
4 changed files with 6 additions and 2 deletions

View file

@ -948,12 +948,14 @@ void CommonCLI::handleRegionCmd(char* command, char* reply) {
if (strcmp(parts[2], "<null>") == 0) {
_region_map->setDefaultRegion(NULL);
_callbacks->onDefaultRegionChanged(NULL);
_callbacks->saveRegions(); // persist in one atomic step
sprintf(reply, " default scope is now <null>");
} else {
auto def = _region_map->findByNamePrefix(parts[2]);
if (def) {
_region_map->setDefaultRegion(def);
_callbacks->onDefaultRegionChanged(def);
_callbacks->saveRegions(); // persist in one atomic step
sprintf(reply, " default scope is now %s", def->name);
} else {
strcpy(reply, "Err - unknown region");

View file

@ -16,6 +16,8 @@ struct RegionEntry {
uint16_t parent;
uint8_t flags;
char name[31];
bool isWildcard() const { return id == 0; }
};
class RegionMap {