Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: signed chars without multibyte support
- X-seq: zsh-workers 23075
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>, pws@xxxxxxxxxxxxxxxxx
- Subject: Re: PATCH: signed chars without multibyte support
- Date: Tue, 19 Dec 2006 21:20:16 +0000
- In-reply-to: Message from Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx> of "Tue, 19 Dec 2006 12:37:37 PST." <20061219203737.GA29672@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Wayne Davison wrote:
> On Tue, Dec 19, 2006 at 12:55:38PM +0000, Peter Stephenson wrote:
> > + *c = x[1] ^ 32;
> [...]
> > + *c = (char)*x;
>
> I don't really like this, as it means that the int value returned can be
> a -1 (EOF) when *x is 0xFF. It would be better to change the code that
> is comparing a char against an int to use STOUC() on the char value in
> the comparison.
Unfortunately all the tokens in zsh.h are defined as ((char) 0x83)
etc. etc., so it's a huge amount of work to make it use unsigned
characters; virtually every use of tokens in the shell requires that
something that began as a char *not* be cast to unsigned.
Historically, the integer value at this point was a simple char; it's
only because of the need to use functions for multibyte characters that
it got changed. It's probably easy enough to put convchar_t back to
char instead of int when there's no multibyte code, but that doesn't
really gain anything.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author