aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2001-10-10 19:44:54 +0000
committerMax Khon <fjoe@FreeBSD.org>2001-10-10 19:44:54 +0000
commitcc6aa31940653b11f2879010d0a941575c770c07 (patch)
tree3b7bfe6239edc3cf673814ff3a98233b78431fe3
parentfc1801e3e90a8dc24dcc43d987218ba4f4f2d2ba (diff)
downloadsrc-cc6aa31940653b11f2879010d0a941575c770c07.tar.gz
src-cc6aa31940653b11f2879010d0a941575c770c07.zip
MFC rev. 1.60: Enable 8bit chars excepting high controls
Notes
Notes: svn path=/stable/3/; revision=84774
-rw-r--r--usr.sbin/syslogd/syslogd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 8c1749c87a23..74a3740121a7 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -587,9 +587,14 @@ printline(hname, msg)
q = line;
- while ((c = *p++ & 0177) != '\0' &&
- q < &line[sizeof(line) - 1])
- if (iscntrl(c))
+ while ((c = (unsigned char)*p++) != '\0' &&
+ q < &line[sizeof(line) - 3]) {
+ if ((c & 0x80) && c < 0xA0) {
+ c &= 0x7F;
+ *q++ = 'M';
+ *q++ = '-';
+ }
+ if (isascii(c) && iscntrl(c)) {
if (c == '\n')
*q++ = ' ';
else if (c == '\t')
@@ -598,8 +603,9 @@ printline(hname, msg)
*q++ = '^';
*q++ = c ^ 0100;
}
- else
+ } else
*q++ = c;
+ }
*q = '\0';
logmsg(pri, line, hname, 0);