mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 08:43:23 +00:00
MFC rev. 1.60: Enable 8bit chars excepting high controls
This commit is contained in:
parent
fc1801e3e9
commit
cc6aa31940
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/3/; revision=84774
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user