From: Alan T. DeKok Date: Sat, 24 Aug 2024 12:14:40 +0000 (-0400) Subject: remove unnecessary code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bbcd8bbd09e3bc005beae30332e69b3d55c5f3c;p=thirdparty%2Ffreeradius-server.git remove unnecessary code --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index 6efce9e5af6..4febffaba93 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -2114,49 +2114,6 @@ static int parse_input(cf_stack_t *stack) return -1; } - /* - * Allow '[' after the attribute name - * - * Hack up a crappy parser. - * - * @todo - call tmpl_preparse(), but that function also looks for leading '&'. - * - * @todo - we probably want to call tmpl_preparse() or something similar for the RHS, too. But - * initially only if we're in an edit section. - * - * For now, this hack is sufficient to parse the only array references we support, which are - * fixed numbers, and a few "special" characters. - */ - if ((parent->unlang == CF_UNLANG_ALLOW) || (parent->unlang == CF_UNLANG_EDIT)) { - if (ptr[0] == '[') { - char *q, *end; - - q = buff[1] + strlen(buff[1]); - end = buff[1] + stack->bufsize; - - while (*ptr && (*ptr != ']')) { - if ((q + 2) >= end) { - *q = '\0'; - goto missing_bracket; - } - *(q++) = *(ptr++); - } - - if (!*ptr) { - missing_bracket: - ERROR("%s[%d]: Missing end ']' in %s", - frame->filename, frame->lineno, buff[1]); - return -1; - } - - q[0] = ']'; - q[1] = '\0'; - ptr++; - - fr_skip_whitespace(ptr); - } - } - /* * See which unlang keywords are allowed */