From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7943 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Byte-based C locale, draft 2 Date: Tue, 16 Jun 2015 00:26:39 -0400 Message-ID: <20150616042639.GE1173@brightrain.aerifal.cx> References: <20150606214007.GA17398@brightrain.aerifal.cx> <20150607025025.GC17573@brightrain.aerifal.cx> <20150613070655.GJ17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1434428817 31196 80.91.229.3 (16 Jun 2015 04:26:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jun 2015 04:26:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7956-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 16 06:26:56 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Z4iSe-0001NJ-6M for gllmg-musl@m.gmane.org; Tue, 16 Jun 2015 06:26:56 +0200 Original-Received: (qmail 29898 invoked by uid 550); 16 Jun 2015 04:26:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 29864 invoked from network); 16 Jun 2015 04:26:52 -0000 Content-Disposition: inline In-Reply-To: <20150613070655.GJ17573@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7943 Archived-At: On Sat, Jun 13, 2015 at 03:06:55AM -0400, Rich Felker wrote: > diff --git a/src/multibyte/btowc.c b/src/multibyte/btowc.c > index 9d2c3b1..8de060f 100644 > --- a/src/multibyte/btowc.c > +++ b/src/multibyte/btowc.c > @@ -1,7 +1,10 @@ > -#include > #include > +#include > +#include "internal.h" > > wint_t btowc(int c) > { > - return c<128U ? c : EOF; > + if (c < 128U) return c; > + if (MB_CUR_MAX==1) return CODEUNIT(c); > + return WEOF; > } This was mildly buggy before the patch, and worse with it -- c==EOF will no longer produce WEOF. Fixed the old bug and updating the patch. Rich