From: Alan T. DeKok Date: Sun, 9 Mar 2025 16:48:31 +0000 (-0400) Subject: %regex() takes variadic args X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b1445439c25de5019b2ab4dd5fabacb85ec3602;p=thirdparty%2Ffreeradius-server.git %regex() takes variadic args --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 61a748d120..3fb075e0b7 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -2662,6 +2662,12 @@ static xlat_action_t xlat_func_randstr(TALLOC_CTX *ctx, fr_dcursor_t *out, #if defined(HAVE_REGEX_PCRE) || defined(HAVE_REGEX_PCRE2) +static xlat_arg_parser_t const xlat_func_regex_args[] = { + { .variadic = XLAT_ARG_VARIADIC_EMPTY_KEEP, .type = FR_TYPE_VOID }, + XLAT_ARG_PARSER_TERMINATOR +}; + + /** Get named subcapture value from previous regex * * Example: @@ -4187,6 +4193,7 @@ do { \ XLAT_REGISTER_PURE("md5", xlat_func_md5, FR_TYPE_OCTETS, xlat_func_md5_arg); #if defined(HAVE_REGEX_PCRE) || defined(HAVE_REGEX_PCRE2) if (unlikely((xlat = xlat_func_register(xlat_ctx, "regex", xlat_func_regex, FR_TYPE_STRING)) == NULL)) return -1; + xlat_func_args_set(xlat, xlat_func_regex_args); xlat_func_flags_set(xlat, XLAT_FUNC_FLAG_INTERNAL); #endif