From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.net.au (8.7/8.7) with SMTP id OAA25665 for ; Wed, 18 Oct 1995 14:50:02 +1000 (EST) Received: from euclid (euclid.skiles.gatech.edu) by gatech.edu with SMTP id AA20530 (5.65c/Gatech-10.0-IDA for ); Wed, 18 Oct 1995 00:46:52 -0400 Received: by euclid (5.x/SMI-SVR4) id AA02648; Wed, 18 Oct 1995 00:45:18 -0400 Resent-Date: Wed, 18 Oct 1995 00:42:49 -0400 Old-Return-Path: Message-Id: <9510180442.AA24279@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.6.4 10/10/95 To: hzoli@cs.elte.hu, pws@ifh.de Cc: zsh-workers@math.gatech.edu Subject: Re: still bugs with 8-bit chars :-( In-Reply-To: Your message of "Tue, 17 Oct 1995 16:02:16 BST." <199510171502.QAA27274@bolyai.cs.elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Oct 1995 00:42:49 -0400 From: Richard Coleman Resent-Message-Id: <"gCm1o.0.If.TP8Xm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/471 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > 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