Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: still bugs with 8-bit chars :-(



> However, Peter's patch is not perfect, since it uses a cast from char to
> unsignec char, which is broken with some compilers.  Here is a fix for that.
> If you have a buggy compiler, this may be your problem.
> 
> 
> *** 1.2	1995/10/10 18:20:38
> --- Src/input.c	1995/10/17 14:57:56
> ***************
> *** 109,115 ****
>   	if (inbufleft) {
>   	    inbufleft--;
>   	    inbufct--;
> ! 	    return lastc = (int)(unsigned char)*inbufptr++;
>   	}
>   	/*
>   	 * No characters in input buffer.
> --- 109,115 ----
>   	if (inbufleft) {
>   	    inbufleft--;
>   	    inbufct--;
> ! 	    return lastc = STOUC(*inbufptr++);
>   	}
>   	/*
>   	 * No characters in input buffer.
> 


Since we already casting anyway, wouldn't the line

    return lastc = (int)(unsigned short)*inbufptr++;

do just as well.  I don't ever use 8-bit characters, so I not
positive about this.

rc



Messages sorted by: Reverse Date, Date, Thread, Author