diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-12 11:17:20 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-12 11:17:20 +0000 |
commit | 4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8 (patch) | |
tree | e1f4d208712d6aed05ff589c157283d1cb7a16c3 | |
parent | 4e535179edb6e7b941276c451f6315c46dbda54a (diff) | |
download | rsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.tar.gz rsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.tar.xz rsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.zip |
fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | syslogd.c | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -14,6 +14,7 @@ Version 3.11.1 (rgerhards), 2008-02-?? tells this feature is not tested and probably not worth the effort. Thanks to Anders Blomdell fro bringing this to our attention - somewhat improved performance of string buffers +- fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf --------------------------------------------------------------------------- Version 3.11.0 (rgerhards), 2008-01-31 - implemented queued actions @@ -4206,17 +4206,21 @@ void sighup_handler() * \param DstSize Maximum numbers of characters to store. * \param cSep Separator char. * \ret int Returns 0 if no error occured. + * + * rgerhards, 2008-02-12: some notes are due... I will once again fix this function, this time + * so that it treats ' ' as a request for whitespace. But in general, the function and its callers + * should be changed over time, this is not really very good code... */ int getSubString(uchar **ppSrc, char *pDst, size_t DstSize, char cSep) { uchar *pSrc = *ppSrc; int iErr = 0; /* 0 = no error, >0 = error */ - while(*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) { + while((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) { *pDst++ = *(pSrc)++; DstSize--; } /* check if the Dst buffer was to small */ - if (*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0') + if ((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0') { dbgprintf("in getSubString, error Src buffer > Dst buffer\n"); iErr = 1; |