From: Alan T. DeKok Date: Fri, 17 Nov 2023 14:16:57 +0000 (-0500) Subject: skip whitespace for comma-separated argv X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f81a23973805f38f069ed109d64a1f9d67d49e9f;p=thirdparty%2Ffreeradius-server.git skip whitespace for comma-separated argv --- diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index 26d146d1a5f..67ab48c34b1 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -1609,35 +1609,10 @@ fr_slen_t xlat_tokenize_argv(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t fr_sbuff_set(&m, &our_in); /* Record start of argument */ argc++; -#if 0 - if (comma) { - fr_assert(p_rules && p_rules->terminals); - - MEM(node = xlat_exp_alloc(head, XLAT_GROUP, NULL, 0)); - if (xlat_tokenize_expression(node, &node->group, &our_in, p_rules, t_rules) <= 0) goto error; - - fmt = talloc_bstrndup(node, fr_sbuff_current(&m), fr_sbuff_behind(&m)); - xlat_exp_set_name_buffer_shallow(node, fmt); - - node->flags = node->group->flags; - node->quote = T_BARE_WORD; - - xlat_debug(node); - - xlat_exp_insert_tail(head, node); - fr_sbuff_set(&m, &our_in); - - if (fr_sbuff_next_if_char(&our_in, ',')) { - fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL); - continue; - } - - if (fr_sbuff_is_char(&our_in, ')')) break; - - fr_strerror_printf("Unexpected text after argument %d", argc); - goto error; - } -#endif + /* + * Whitespace isn't significant for comma-separated argvs + */ + if (comma) fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL); fr_sbuff_out_by_longest_prefix(&slen, "e, xlat_quote_table, &our_in, T_BARE_WORD); @@ -1759,7 +1734,6 @@ fr_slen_t xlat_tokenize_argv(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t fr_assert(p_rules && p_rules->terminals); if (fr_sbuff_next_if_char(&our_in, ',')) { - fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL); continue; }