summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-29 14:25:16 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-29 14:25:16 +0200
commit84e6045980acf701efd1c1626f37ea9abda9e76e (patch)
treed98fbb7878738926e8a276d43f6a1ec465414cc7 /tools
parentcd6f19ab7ab3356dd545d0bfc7e338d5f5f9c9d8 (diff)
parent53fc3b9af9d257db5ad7b0f8019569e36dc35ce4 (diff)
downloadrsyslog-84e6045980acf701efd1c1626f37ea9abda9e76e.tar.gz
rsyslog-84e6045980acf701efd1c1626f37ea9abda9e76e.tar.xz
rsyslog-84e6045980acf701efd1c1626f37ea9abda9e76e.zip
Merge branch 'master' into v5-devel
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index db52effc..47fa2f58 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1323,21 +1323,26 @@ static int parseRFCStructuredData(uchar **pp2parse, uchar *pResult)
if(*p2parse != '[')
return 1; /* this is NOT structured data! */
- while(bCont) {
- if(*p2parse == '\0') {
- iRet = 1; /* this is not valid! */
- bCont = 0;
- } else if(*p2parse == '\\' && *(p2parse+1) == ']') {
- /* this is escaped, need to copy both */
- *pResult++ = *p2parse++;
- *pResult++ = *p2parse++;
- } else if(*p2parse == ']' && *(p2parse+1) == ' ') {
- /* found end, just need to copy the ] and eat the SP */
- *pResult++ = *p2parse;
- p2parse += 2;
- bCont = 0;
- } else {
- *pResult++ = *p2parse++;
+ if(*p2parse == '-') { /* empty structured data? */
+ *pResult++ = '-';
+ ++p2parse;
+ } else {
+ while(bCont) {
+ if(*p2parse == '\0') {
+ iRet = 1; /* this is not valid! */
+ bCont = 0;
+ } else if(*p2parse == '\\' && *(p2parse+1) == ']') {
+ /* this is escaped, need to copy both */
+ *pResult++ = *p2parse++;
+ *pResult++ = *p2parse++;
+ } else if(*p2parse == ']' && *(p2parse+1) == ' ') {
+ /* found end, just need to copy the ] and eat the SP */
+ *pResult++ = *p2parse;
+ p2parse += 2;
+ bCont = 0;
+ } else {
+ *pResult++ = *p2parse++;
+ }
}
}