diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-29 14:24:58 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-29 14:24:58 +0200 |
commit | 53fc3b9af9d257db5ad7b0f8019569e36dc35ce4 (patch) | |
tree | 802facfa518a3c8d3dd2e8e165bc88bbd572442a /tools | |
parent | 8e180e152ab1cd332a212648d6a0f2e2583a2bca (diff) | |
parent | 02929c7bbf1189a4fc96e42fb127f2f04a279719 (diff) | |
download | rsyslog-53fc3b9af9d257db5ad7b0f8019569e36dc35ce4.tar.gz rsyslog-53fc3b9af9d257db5ad7b0f8019569e36dc35ce4.tar.xz rsyslog-53fc3b9af9d257db5ad7b0f8019569e36dc35ce4.zip |
Merge branch 'beta'
Diffstat (limited to 'tools')
-rw-r--r-- | tools/syslogd.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index 69c24ae6..d925505f 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1311,21 +1311,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++; + } } } |