From: Alan T. DeKok Date: Fri, 11 Apr 2025 00:55:16 +0000 (-0400) Subject: minor cleanups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32dd60308e5bab22faac38196a58a100140106f3;p=thirdparty%2Ffreeradius-server.git minor cleanups --- diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 8dddb1bfc1c..52208da578e 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -378,7 +378,7 @@ static xlat_action_t xlat_process_arg_list(TALLOC_CTX *ctx, fr_value_box_list_t fr_assert(node->type == XLAT_GROUP); /* - * Concatenate child boxes, then to the desired type. + * Concatenate child boxes, then cast to the desired type. */ if (concat) { if (fr_value_box_list_concat_in_place(ctx, vb, list, type, FR_VALUE_BOX_LIST_FREE, true, SIZE_MAX) < 0) { diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index 086df62fd84..be1c6208f33 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -181,7 +181,6 @@ static int xlat_tmpl_normalize(xlat_exp_t *node) return 0; } -#if 0 /* * We have a nested xlat. This is likely bad. The caller SHOULD have checked for %{...}, and * created an XLAT_GROUP, and then parsed that. @@ -189,10 +188,8 @@ static int xlat_tmpl_normalize(xlat_exp_t *node) if (tmpl_contains_xlat(vpt)) { fr_assert(!tmpl_needs_resolving(vpt)); fr_assert(!tmpl_contains_regex(vpt)); - return 0; } -#endif if (!tmpl_contains_data(vpt)) { fr_assert(!tmpl_needs_resolving(vpt)); diff --git a/src/tests/unit/xlat/purify.txt b/src/tests/unit/xlat/purify.txt index a5158014506..755f920327c 100644 --- a/src/tests/unit/xlat/purify.txt +++ b/src/tests/unit/xlat/purify.txt @@ -227,9 +227,6 @@ match "hello 3" xlat_purify "hello " + (string)%{1 + 2} + " bob" match "hello 3 bob" -# -# @todo - xlat_purify doesn't hoist results. -# xlat_purify "hello %{1 + 2} bob" match "hello 3 bob" @@ -244,9 +241,6 @@ match 0xacbd18db4cc2f85cedef654fccc4a4d8 xlat_purify %explode("a,b,c,d", ',') match "a""b""c""d" -# -# @todo - bare words should probably be disallowed -# xlat_purify %md5('foo') match 0xacbd18db4cc2f85cedef654fccc4a4d8