From: Alan T. DeKok Date: Thu, 10 Oct 2019 17:58:22 +0000 (-0400) Subject: use unlang ops table instead of compile table X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6de29fe963f5bddc96ce282ebd69c3db891a1f2e;p=thirdparty%2Ffreeradius-server.git use unlang ops table instead of compile table --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index ba31922d9a4..af18abeba21 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -3668,13 +3668,11 @@ bool unlang_compile_is_keyword(const char *name) if (!name || !*name) return false; - for (i = 1; compile_table[i].name != NULL; i++) { - if (strcmp(name, compile_table[i].name) == 0) return true; - } + for (i = UNLANG_TYPE_GROUP; i<= UNLANG_TYPE_POLICY; i++) { + if (!unlang_ops[i].name) continue; - if (strcmp(name, "break") == 0) return true; - if (strcmp(name, "detach") == 0) return true; - if (strcmp(name, "return") == 0) return true; + if (strcmp(name, unlang_ops[i].name) == 0) return true; + } return false; }