summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-12-13 11:03:45 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-12-13 11:03:45 +0100
commita072dac3638c399303b3308dbb1c5bbdfc59022b (patch)
treeb03b8e7a2fd78aa64abd7ec3bc6819b043577812 /parse.c
parent1cd51a5d5a8a2c662e9ebcdea12b2ae01afd34d3 (diff)
parent925b060b2932a7f9ddee1e0fcbaa6266ba03d8b1 (diff)
downloadrsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.tar.gz
rsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.tar.bz2
rsyslog-a072dac3638c399303b3308dbb1c5bbdfc59022b.zip
Merge branch 'lognorm' + some doc added
Conflicts: ChangeLog
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index e335d423..a156b317 100644
--- a/parse.c
+++ b/parse.c
@@ -231,7 +231,8 @@ rsRetVal parsSkipWhitespace(rsParsObj *pThis)
/* Parse string up to a delimiter.
*
* Input:
- * cDelim - the delimiter
+ * cDelim - the delimiter. Note that SP within a value always is a delimiter,
+ * so cDelim is actually an *additional* delimiter.
* The following two are for whitespace stripping,
* 0 means "no", 1 "yes"
* - bTrimLeading
@@ -256,13 +257,13 @@ rsRetVal parsDelimCStr(rsParsObj *pThis, cstr_t **ppCStr, char cDelim, int bTrim
pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
- while(pThis->iCurrPos < rsCStrLen(pThis->pCStr) && *pC != cDelim) {
+ while(pThis->iCurrPos < rsCStrLen(pThis->pCStr) && *pC != cDelim && *pC != ' ') {
CHKiRet(cstrAppendChar(pCStr, bConvLower ? tolower(*pC) : *pC));
++pThis->iCurrPos;
++pC;
}
- if(*pC == cDelim) {
+ if(pThis->iCurrPos < cstrLen(pThis->pCStr)) { //BUGFIX!!
++pThis->iCurrPos; /* eat delimiter */
}