return buffer;
}
+static int seen_too_much(const char *filename, int lineno, const char *ptr)
+{
+ while (*ptr) {
+ if (isspace(*ptr)) {
+ ptr++;
+ continue;
+ }
+
+ if (*ptr == '#') return FALSE;
+
+ break;
+ }
+
+ if (*ptr) {
+ radlog(L_ERR, "%s[%d] Unexpected text %s. See \"man unlang\"",
+ filename, lineno, ptr);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/*
* Read a part of the config file.
}
this = this->item.parent;
+ if (seen_too_much(filename, *lineno, ptr)) return -1;
continue;
}
buf2[end - ptr + 1] = '\0';
ptr = end + 1;
t2 = T_BARE_WORD;
+
+ if (gettoken(&ptr, buf3, sizeof(buf3)) != T_LCBRACE) {
+ radlog(L_ERR, "%s[%d]: Expected '{'",
+ filename, *lineno);
+ return -1;
+ }
goto section_alloc;
} else {
case T_LCBRACE:
section_alloc:
+ if (seen_too_much(filename, *lineno, ptr)) return -1;
+
css = cf_section_alloc(buf1,
t2 == T_LCBRACE ? NULL : buf2,
this);