]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
partial parse is only if at eol, and depth==0, and terminal character
authorAlan T. DeKok <aland@freeradius.org>
Fri, 20 Jan 2023 14:51:20 +0000 (09:51 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 20 Jan 2023 14:59:41 +0000 (09:59 -0500)
src/lib/server/cf_file.c

index 2178e3791f1eb2bbfc06a124f79633e6b6ad9c40..5a351f5980528a8f1233da8d7e71f1921bd1d0ab 100644 (file)
@@ -1461,7 +1461,7 @@ static ssize_t fr_skip_condition(char const *start, char const *end, bool const
        /*
         *      We've fallen off of the end of a string.  It may be OK?
         */
-       if (eol) *eol = true;
+       if (eol) *eol = (depth > 0);
 
        if (terminal && terminal[(uint8_t) *p]) return p - start;
 
@@ -2447,9 +2447,9 @@ check_for_eol:
                }
 
                /*
-                *      If don't hit EOL, then maybe we hit an end character?
+                *      We parsed until the end of the string, but the condition still needs more data.
                 */
-               if (!eol && !terminal_end_line[(uint8_t) ptr[slen]]) {
+               if (eol) {
                        ERROR("%s[%d]: FIXME: EOL continuation not implemented",
                              frame->filename, frame->lineno);
                        return -1;
@@ -2457,8 +2457,6 @@ check_for_eol:
 
                /*
                 *      Keep a copy of the entire RHS.
-                *
-                *      @todo - mark up the RHS as somehow an expression?
                 */
                memcpy(buff[2], ptr, slen);
                buff[2][slen] = '\0';