|
Message-ID: <20150616043502.GF1173@brightrain.aerifal.cx>
Date: Tue, 16 Jun 2015 00:35:02 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Byte-based C locale, draft 2
On Tue, Jun 16, 2015 at 12:26:39AM -0400, Rich Felker wrote:
> 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 <stdio.h>
> > #include <wchar.h>
> > +#include <stdlib.h>
> > +#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.
Updated version of this file's patch (against the fixed old code which
I already committed) is attached.
Rich
View attachment "bytelocale_new_btowc.diff" of type "text/plain" (448 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.