]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use unlang ops table instead of compile table
authorAlan T. DeKok <aland@freeradius.org>
Thu, 10 Oct 2019 17:58:22 +0000 (13:58 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 11 Oct 2019 16:31:48 +0000 (12:31 -0400)
src/lib/unlang/compile.c

index ba31922d9a4356317c8a3a047803cb467519450b..af18abeba2143f65728cbf618196abeb9527e265 100644 (file)
@@ -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;
 }