summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-27 14:13:15 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-27 14:13:15 +0200
commit86faa4ece6876c9ee89e631552785cd1a46e106f (patch)
tree40d015f52446ce7a22e0fc5eb3b2400cb25ea556
parent589744bc5742c2b8e2cb1240e3912f2702189733 (diff)
downloadrsyslog-86faa4ece6876c9ee89e631552785cd1a46e106f.tar.gz
rsyslog-86faa4ece6876c9ee89e631552785cd1a46e106f.tar.bz2
rsyslog-86faa4ece6876c9ee89e631552785cd1a46e106f.zip
Improve syntax error messages by outputting the error token
-rw-r--r--ChangeLog1
-rw-r--r--runtime/rsconf.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index dcb6993e..dc7f8431 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
----------------------------------------------------------------------------
Version 7.2.1 [v7-stable] 2012-10-??
+- improved syntax error messages by outputting the error token
- the rsyslog core now suspeneds actions after 10 failures in a row
This was former the case after 1,000 failures and could cause rsyslog
to be spammed/ressources misused. See the v6 compatibility doc for more
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index ad588832..dcaa1ad9 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -67,6 +67,7 @@
#include "dirty.h"
#include "template.h"
+extern char* yytext;
/* static data */
DEFobjStaticHelpers
DEFobjCurrIf(ruleset)
@@ -390,7 +391,7 @@ parser_errmsg(char *fmt, ...)
int
yyerror(char *s)
{
- parser_errmsg("%s", s);
+ parser_errmsg("%s on token '%s'", s, yytext);
return 0;
}
void cnfDoObj(struct cnfobj *o)