summaryrefslogtreecommitdiff
path: root/nest/cmds.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-02 20:29:03 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-04 15:38:42 +0200
commit165156beeb2926472bbceca3c103aacc3f81a8cc (patch)
tree483ee32846c8758ded4b8c4bfeea3d3ae07a21d2 /nest/cmds.c
parentcf07d8ad79273a3bbf0617c17e438602e4b64ece (diff)
Conf: Symbols are properly scoped
Now there is a persistent root symbol scope and all scopes have their symbol hashes to store local symbols and not leak any symbol out.
Diffstat (limited to 'nest/cmds.c')
-rw-r--r--nest/cmds.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/nest/cmds.c b/nest/cmds.c
index 99a7bbfe..092be48a 100644
--- a/nest/cmds.c
+++ b/nest/cmds.c
@@ -51,17 +51,18 @@ cmd_show_symbols(struct sym_show_data *sd)
cli_msg(1010, "%-8s\t%s", sd->sym->name, cf_symbol_class_name(sd->sym));
else
{
- HASH_WALK(config->sym_hash, next, sym)
- {
- if (!sym->scope->active)
- continue;
-
- if (sd->type && (sym->class != sd->type))
- continue;
-
- cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
- }
- HASH_WALK_END;
+ for (const struct sym_scope *scope = config->root_scope; scope; scope = scope->next)
+ HASH_WALK(scope->hash, next, sym)
+ {
+ if (!sym->scope->active)
+ continue;
+
+ if (sd->type && (sym->class != sd->type))
+ continue;
+
+ cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
+ }
+ HASH_WALK_END;
cli_msg(0, "");
}