summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 5920988c..65af51e8 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2302,8 +2302,20 @@ int shouldProcessThisMessage(selector_t *f, msg_t *pMsg)
}
if(f->pCSProgNameComp != NULL) {
- if(rsCStrSzStrCmp(f->pCSProgNameComp, (uchar*) getProgramName(pMsg), getProgramNameLen(pMsg))) {
- /* not equal, so we are already done... */
+ int bInv = 0, bEqv = 0, offset = 0;
+ if(*(rsCStrGetSzStr(f->pCSProgNameComp)) == '-') {
+ if(*(rsCStrGetSzStr(f->pCSProgNameComp) + 1) == '-')
+ offset = 1;
+ else {
+ bInv = 1;
+ offset = 1;
+ }
+ }
+ if(!rsCStrOffsetSzStrCmp(f->pCSProgNameComp, offset, (uchar*) getProgramName(pMsg), getProgramNameLen(pMsg)))
+ bEqv = 1;
+
+ if((!bEqv && !bInv) || (bEqv && bInv)) {
+ /* not equal or inverted selection, so we are already done... */
dbgprintf("programname filter '%s' does not match '%s'\n",
rsCStrGetSzStr(f->pCSProgNameComp), getProgramName(pMsg));
return 0;