* Bug in zsh 3.0.0
@ 1996-09-16 11:37 Goran Larsson
0 siblings, 0 replies; only message in thread
From: Goran Larsson @ 1996-09-16 11:37 UTC (permalink / raw)
To: zsh-workers
Hello.
I just found this:
zsh> ^D (space and ^D)
zsh: do you wish to see all 1344 possibilities? ÿ (^C)
zsh>
I expected that it would echo "n", not "ÿ" (ÿ is 0xFF in ISO-8859-1).
The problem is in getzlequery() in zle_utils.c where getkey() is
called, but EOF is not checked for.
---->8-------->8-------->8-------->8-------->8-------->8-------->8----
*** zle_utils.c,DIST Sat Aug 3 00:08:55 1996
--- zle_utils.c Mon Sep 16 13:31:03 1996
***************
*** 327,332 ****
--- 327,334 ----
c = 'y';
else if (icntrl(c))
c = 'n';
+ else if (c == EOF)
+ c = 'n';
else
c = tulower(c);
---->8-------->8-------->8-------->8-------->8-------->8-------->8----
While looking at getkey() in zle_main.c I found that it can return
EOF, -1, or a key. It is extremely common for EOF to be -1, so what
is the intention with having getkey() return both EOF and -1?
Shouldn't this
return (r <= 0) ? -1 : cc;
be changed into this?
return (r <= 0) ? EOF : cc;
Or should my patch above also check for -1 (for machines where EOF
is not -1)?
--
Goran Larsson mailto:hoh@approve.se
I was an atheist, http://home1.swipnet.se/%7Ew-12153/
until I found out I was God.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-09-16 12:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-16 11:37 Bug in zsh 3.0.0 Goran Larsson
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).