(copy_ascii_no_funny, copy_utf8_no_funny)

(copy_utf8_to_ascii_no_funny): Don't consider newline funny.  This
fixes output filtering broken in rev. 1.17.
This commit is contained in:
Markus Armbruster 2005-06-14 05:01:26 +00:00
parent 2f847f874d
commit a38ffacc37

View file

@ -507,8 +507,8 @@ copy_ascii_no_funny(char *dst, char *src)
p = dst;
while ((ch = *src++)) {
if ((ch < 0x20 && ch != '\t') || ch == 0x7f)
; /* ignore control */
if ((ch < 0x20 && ch != '\t' && ch != '\n') || ch == 0x7f)
; /* ignore funny control */
else if (ch > 0x7f)
*p++ = '?'; /* replace non-ASCII */
else
@ -536,8 +536,8 @@ copy_utf8_no_funny(char *dst, char *src)
p = dst;
while ((ch = *src++)) {
/* FIXME do the right thing for malformed and overlong sequences */
if ((ch < 0x20 && ch != '\t') || ch == 0x7f)
; /* ignore control */
if ((ch < 0x20 && ch != '\t' && ch != '\n') || ch == 0x7f)
; /* ignore funny control */
else
*p++ = ch;
}
@ -563,8 +563,8 @@ copy_utf8_to_ascii_no_funny(char *dst, char *src)
p = dst;
while ((ch = *src++)) {
/* FIXME do the right thing for malformed and overlong sequences */
if ((ch < 0x20 && ch != '\t') || ch == 0x7f)
; /* ignore control */
if ((ch < 0x20 && ch != '\t' && ch != '\n') || ch == 0x7f)
; /* ignore funny control */
else if (ch > 0x7f) {
*p++ = '?'; /* replace non-ASCII */
while ((*src++ & 0xc0) == 0x80) ;