summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 09:54:58 +0000
commitf02d615052e325616d7042096cea6e5247a980dc (patch)
treefed57a226daf1f0e052ead727fe99b858c3f1331 /conf.c
parent0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (diff)
downloadrsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.gz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.tar.xz
rsyslog-f02d615052e325616d7042096cea6e5247a980dc.zip
- basic implementation of expression parser parsing done
- improved ABNF a bit
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index 6e03e5b8..fbf3e224 100644
--- a/conf.c
+++ b/conf.c
@@ -733,6 +733,7 @@ static rsRetVal cflineProcessIfFilter(uchar **pline, register selector_t *f)
{
DEFiRet;
ctok_t *ctok;
+ ctok_token_t *pToken;
ASSERT(pline != NULL);
ASSERT(*pline != NULL);
@@ -759,11 +760,19 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline);
/* ready to go... */
CHKiRet(exprParse(f->f_filterData.f_expr, ctok));
- /* we are back, so we now need to restore things */
- CHKiRet(ctokGetpp(ctok, pline));
+ /* we now need to parse off the "then" - and note an error if it is
+ * missing...
+ */
+ CHKiRet(ctokGetToken(ctok, &pToken));
+ if(pToken->tok != ctok_THEN) {
+ ABORT_FINALIZE(RS_RET_SYNTAX_ERROR);
+ }
+ /* we are done, so we now need to restore things */
+ CHKiRet(ctokGetpp(ctok, pline));
CHKiRet(ctokDestruct(&ctok));
-dbgprintf("end expression parser, pp %p ('%s')\n", *pline, *pline);
+
+dbgprintf("expression parser successfully ended, pp %p ('%s')\n", *pline, *pline);
finalize_it:
if(iRet == RS_RET_SYNTAX_ERROR) {