From 6c16044d8d28a5f6cc02280eaa531487e472f629 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 21 Sep 2023 18:45:08 -0700 Subject: [PATCH] wc: stop worrying about EBCDIC, shift-JIS, etc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/wc.c: Do not include mbchar.h. (wc): Check for ASCII characters instead of using is_basic. Other parts of Gnulib and coreutils already assume the encoding is upward compatible with ASCII, and the old code wouldn’t have worked anyway with shift-JIS. --- src/wc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wc.c b/src/wc.c index 6b802f5c7f..130be8c32c 100644 --- a/src/wc.c +++ b/src/wc.c @@ -31,7 +31,6 @@ #include "argmatch.h" #include "argv-iter.h" #include "fadvise.h" -#include "mbchar.h" #include "physmem.h" #include "readtokens0.h" #include "safe-read.h" @@ -490,7 +489,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos) size_t n; bool wide = true; - if (!in_shift && is_basic (*p)) + if (!in_shift && 0 <= *p && *p < 0x80) { /* Handle most ASCII characters quickly, without calling mbrtowc(). */ -- 2.47.2