diff options
author | Andre Lorbach <alorbach@adiscon.com> | 2011-08-05 14:22:46 +0200 |
---|---|---|
committer | Andre Lorbach <alorbach@adiscon.com> | 2011-08-05 14:22:46 +0200 |
commit | ece1cb640926848d0d155f29b01a6406af441cb0 (patch) | |
tree | 2c95c3a5a31ef0b8befcf3da38af23c5e583e84e /runtime | |
parent | e86a4b8feb7796ebaa66c9f0a067eb6b104a089c (diff) | |
parent | d788daafa4e8bda5fe544718b5f420f22cd79996 (diff) | |
download | rsyslog-ece1cb640926848d0d155f29b01a6406af441cb0.tar.gz rsyslog-ece1cb640926848d0d155f29b01a6406af441cb0.tar.xz rsyslog-ece1cb640926848d0d155f29b01a6406af441cb0.zip |
Merge branch 'v5-stable' into beta
Conflicts:
ChangeLog
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index c5cbb5c8..f1701909 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2926,6 +2926,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, } } +dbgprintf("prop repl 4, pRes='%s', len %d\n", pRes, bufLen); /* Take care of spurious characters to make the property safe * for a path definition */ @@ -3003,7 +3004,13 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, } /* check for "." and ".." (note the parenthesis in the if condition!) */ - if((*pRes == '.') && (*(pRes + 1) == '\0' || (*(pRes + 1) == '.' && *(pRes + 2) == '\0'))) { + if(*pRes == '\0') { + if(*pbMustBeFreed == 1) + free(pRes); + pRes = UCHAR_CONSTANT("_"); + bufLen = 1; + *pbMustBeFreed = 0; + } else if((*pRes == '.') && (*(pRes + 1) == '\0' || (*(pRes + 1) == '.' && *(pRes + 2) == '\0'))) { uchar *pTmp = pRes; if(*(pRes + 1) == '\0') @@ -3013,12 +3020,6 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, if(*pbMustBeFreed == 1) free(pTmp); *pbMustBeFreed = 0; - } else if(*pRes == '\0') { - if(*pbMustBeFreed == 1) - free(pRes); - pRes = UCHAR_CONSTANT("_"); - bufLen = 1; - *pbMustBeFreed = 0; } } @@ -3090,6 +3091,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, bufLen = ustrlen(pRes); *pPropLen = bufLen; +dbgprintf("end prop repl, pRes='%s', len %d\n", pRes, bufLen); ENDfunc return(pRes); } |