diff options
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/syslog.conf.5 | 14 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/usr.sbin/syslogd/syslog.conf.5 b/usr.sbin/syslogd/syslog.conf.5 index 7275fe6..d85e73f 100644 --- a/usr.sbin/syslogd/syslog.conf.5 +++ b/usr.sbin/syslogd/syslog.conf.5 @@ -406,6 +406,20 @@ normally the superuser. Blank lines and lines whose first non-blank character is a hash .Pq Dq # character are ignored. +If +.Ql # +is placed in the middle of the line, the +.Ql # +character and the rest of the line after it is ignored. +To prevent special meaning, the +.Ql # +character may be escaped with +.Ql \e ; +in this case preceding +.Ql \e +is removed and +.Ql # +is treated as an ordinary character. .Sh IMPLEMENTATION NOTES The .Dq kern diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 7ca7061..b4e5d41 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1662,6 +1662,17 @@ init(int signo) prog[i] = 0; continue; } + for (p = cline + 1; *p != '\0'; p++) { + if (*p != '#') + continue; + if (*(p - 1) == '\\') { + strcpy(p - 1, p); + p--; + continue; + } + *p = '\0'; + break; + } for (i = strlen(cline) - 1; i >= 0 && isspace(cline[i]); i--) cline[i] = '\0'; f = (struct filed *)calloc(1, sizeof(*f)); |