Project

General

Profile

Bug #2924 ยป patch-dfbsd-cat-vflag.txt

remove isprint check & switch setlocale() to use LC_ALL - sevan, 07/11/2016 07:17 AM

 
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index a2aff71..449f12e 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -77,7 +77,7 @@ main(int argc, char **argv)
{
int ch;
- setlocale(LC_CTYPE, "");
+ setlocale(LC_ALL, "");
while ((ch = getopt(argc, argv, "benstuv")) != -1)
switch (ch) {
@@ -206,7 +206,7 @@ cook_cat(FILE *fp)
continue;
}
} else if (vflag) {
- if (!isascii(ch) && !isprint(ch)) {
+ if (!isascii(ch)) {
if (putchar('M') == EOF || putchar('-') == EOF)
break;
ch = toascii(ch);
    (1-1/1)