summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-23 17:29:04 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-23 17:29:04 +0200
commit5cddb0533b53f8acfa36a65a4337ff368aa980de (patch)
tree3843f5d24c817c5ff7f0c60f05025abce80e864a /runtime/msg.c
parent9cd8a73cb633a1e4e8b4babd0708d5640aa91445 (diff)
downloadrsyslog-5cddb0533b53f8acfa36a65a4337ff368aa980de.tar.gz
rsyslog-5cddb0533b53f8acfa36a65a4337ff368aa980de.tar.bz2
rsyslog-5cddb0533b53f8acfa36a65a4337ff368aa980de.zip
fix VAR handling in script grammar and code
The $-var designator is now correctly stripped off the varname.
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 3690a8b4..c9ac507e 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -4068,9 +4068,9 @@ msgSetJSONFromVar(msg_t *pMsg, uchar *varname, struct var *v)
ABORT_FINALIZE(RS_RET_ERR);
}
/* we always know strlen(varname) > 2 */
- if(varname[1] == '!')
+ if(varname[0] == '!')
msgAddJSONObj(pMsg, varname+1, json, &pMsg->json);
- else if(varname[1] == '.')
+ else if(varname[0] == '.')
msgAddJSONObj(pMsg, varname+1, json, &pMsg->localvars);
else { /* global - '/' */
pthread_rwlock_wrlock(&glblVars_rwlock);