From: Paul Eggert Date: Fri, 22 Sep 2023 01:45:08 +0000 (-0700) Subject: wc: stop worrying about EBCDIC, shift-JIS, etc X-Git-Tag: v9.5~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c16044d8d28a5f6cc02280eaa531487e472f629;p=thirdparty%2Fcoreutils.git wc: stop worrying about EBCDIC, shift-JIS, etc * 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. --- 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(). */