zsh-workers
 help / color / mirror / code / Atom feed
* still bugs with 8-bit chars :-(
@ 1995-10-17 12:46 Carlos Carvalho
  1995-10-17 15:02 ` Zoltan Hidvegi
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos Carvalho @ 1995-10-17 12:46 UTC (permalink / raw)
  To: zsh-workers

The problem with accented chars still exist, and this time also in
completion. If you try to complete the file "revalida\347\343o.tex"
(the \??? are the ascii spelling of the octal codes) it starts to
complete all files in the directory.

If you type the name directly such as in "tex revalida\347\343o.tex",
zsh cuts it before the first accented char, and thinks that "o.tex" is
another command.

This is after applying Peter's patch.

Carlos


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: still bugs with 8-bit chars :-(
  1995-10-17 12:46 still bugs with 8-bit chars :-( Carlos Carvalho
@ 1995-10-17 15:02 ` Zoltan Hidvegi
  1995-10-17 21:48   ` Carlos Carvalho
  1995-10-18  4:42   ` Richard Coleman
  0 siblings, 2 replies; 5+ messages in thread
From: Zoltan Hidvegi @ 1995-10-17 15:02 UTC (permalink / raw)
  To: Carlos Carvalho; +Cc: zsh-workers

Carlos Carvalho wrote:
> 
> The problem with accented chars still exist, and this time also in
> completion. If you try to complete the file "revalida\347\343o.tex"
> (the \??? are the ascii spelling of the octal codes) it starts to
> complete all files in the directory.
> 
> If you type the name directly such as in "tex revalida\347\343o.tex",
> zsh cuts it before the first accented char, and thinks that "o.tex" is
> another command.
> 
> This is after applying Peter's patch.

This works for me with 2.6-beta11-test9-hzoli11.  2.6-beta11-test9 should also
work.

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.

Bye,
  Zoltan

*** 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: still bugs with 8-bit chars :-(
  1995-10-17 15:02 ` Zoltan Hidvegi
@ 1995-10-17 21:48   ` Carlos Carvalho
  1995-10-18  4:42   ` Richard Coleman
  1 sibling, 0 replies; 5+ messages in thread
From: Carlos Carvalho @ 1995-10-17 21:48 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

Zoltan Hidvegi (hzoli@cs.elte.hu) wrote on 17 October 1995 16:02:

 >Carlos Carvalho wrote:
 >> 
 >> The problem with accented chars still exist, and this time also in
 >> completion. If you try to complete the file "revalida\347\343o.tex"
 >> (the \??? are the ascii spelling of the octal codes) it starts to
 >> complete all files in the directory.
 >> 
 >> If you type the name directly such as in "tex revalida\347\343o.tex",
 >> zsh cuts it before the first accented char, and thinks that "o.tex" is
 >> another command.

 >This works for me with 2.6-beta11-test9-hzoli11.  2.6-beta11-test9
 >should also work.

Confirmed with 2.6-beta11-test9-hzoli11. Ouf!! 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: still bugs with 8-bit chars :-(
  1995-10-17 15:02 ` Zoltan Hidvegi
  1995-10-17 21:48   ` Carlos Carvalho
@ 1995-10-18  4:42   ` Richard Coleman
  1995-10-18 12:47     ` Zoltan Hidvegi
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Coleman @ 1995-10-18  4:42 UTC (permalink / raw)
  To: hzoli, pws; +Cc: zsh-workers

> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: still bugs with 8-bit chars :-(
  1995-10-18  4:42   ` Richard Coleman
@ 1995-10-18 12:47     ` Zoltan Hidvegi
  0 siblings, 0 replies; 5+ messages in thread
From: Zoltan Hidvegi @ 1995-10-18 12:47 UTC (permalink / raw)
  To: Richard Coleman; +Cc: zsh-workers

Richard wrote:
> 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.

Yes, that should work as well.  Even a simple (unsigned)*inbufptr++ should
work, as this can be seen in hist.c near line 289.

Cheers,
   Zoltan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1995-10-18 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-10-17 12:46 still bugs with 8-bit chars :-( Carlos Carvalho
1995-10-17 15:02 ` Zoltan Hidvegi
1995-10-17 21:48   ` Carlos Carvalho
1995-10-18  4:42   ` Richard Coleman
1995-10-18 12:47     ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).