diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 09:54:58 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 09:54:58 +0000 |
commit | f02d615052e325616d7042096cea6e5247a980dc (patch) | |
tree | fed57a226daf1f0e052ead727fe99b858c3f1331 /conf.c | |
parent | 0af8d22ff6e9fbd8eb89a1612ecf4604f058f78c (diff) | |
download | rsyslog-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.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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) { |