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

beta12: 8-bit-cleanliness



Missing 8-bit-cleanliness especially WRT filename generation.
It was in zsh up to the release of 2.6-beta10. Imagine the names of your
working files deliberately scattered with extended characters from i.e.
the ISO-8859-1 character set. With beta12 this results in mysteriously
disappearing command lines, and worse, infinite loops in the lexer, when
completion is requested upon one of those names.

Tracking that down led to a dubious (unsigned) cast in input.c, present
since rev. 1.5. It does the same as (int)(unsigned int). But we want the
effect of (int)(unsigned char) instead:

*** 1.7	1995/11/16 03:08:25
--- input.c	1995/11/22 01:08:49
***************
*** 127,133 ****
  	if (inbufleft) {
  	    inbufleft--;
  	    inbufct--;
! 	    return lastc = (unsigned)*inbufptr++;
  	}
  	/*
  	 * No characters in input buffer.
--- 127,133 ----
  	if (inbufleft) {
  	    inbufleft--;
  	    inbufct--;
! 	    return lastc = (unsigned char)*inbufptr++;
  	}
  	/*
  	 * No characters in input buffer.


After fixing this one might start to wonder about the metamorphoses
these 8-bit-characters are subjected to, notably in prompt and history:

  aglaia% mkdir zsh\ über\ alles
  aglaia% history
      1  mkdir zsh\ ^¼ber\ alles
      2  history
  aglaia% !1:s/mkdir/cd
  cd zsh\ über\ alles
  aglaia% print -lP '%c'
  zsh ^über alles


Regards,
--Thorsten

(set { bottle, of beer, on the wall};set {{100..2}$1s,1$1,no more$1s}{$2$3.
,$2$3\, ,"$2.\nTake one down, pass it around, "};echo -n ${(j::)@[2,301]})



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