Enable 8bit chars excepting high controls

This commit is contained in:
ache 2000-04-18 01:12:27 +00:00
parent 4aa66e64cd
commit 2e1592d902

View File

@ -577,9 +577,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')
@ -588,8 +593,9 @@ printline(hname, msg)
*q++ = '^';
*q++ = c ^ 0100;
}
else
} else
*q++ = c;
}
*q = '\0';
logmsg(pri, line, hname, 0);