summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorAndre Lorbach <alorbach@adiscon.com>2011-08-05 14:19:19 +0200
committerAndre Lorbach <alorbach@adiscon.com>2011-08-05 14:19:19 +0200
commitf7ad5aeff03833879957ef00136610d1138a7212 (patch)
tree7184cfd244339efc014f4007829ec316ab4aa0b3 /runtime
parent4e11040e04c7147f9787e2a496591f7ada190480 (diff)
parentd788daafa4e8bda5fe544718b5f420f22cd79996 (diff)
downloadrsyslog-f7ad5aeff03833879957ef00136610d1138a7212.tar.gz
rsyslog-f7ad5aeff03833879957ef00136610d1138a7212.tar.xz
rsyslog-f7ad5aeff03833879957ef00136610d1138a7212.zip
Merge branch 'v5-stable' into v5-devel
Conflicts: ChangeLog
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index d1e67aa2..8c8e9670 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2868,6 +2868,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
*/
@@ -2945,7 +2946,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')
@@ -2955,12 +2962,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;
}
}
@@ -3032,6 +3033,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);
}