zsh-workers
 help / color / mirror / code / Atom feed
From: hoh@approve.se (Goran Larsson)
To: zsh-workers@math.gatech.edu
Subject: Bug in zsh 3.0.0
Date: Mon, 16 Sep 1996 13:37:23 +0200 (MET-DST)	[thread overview]
Message-ID: <m0v2bzP-000X3aC@lorelei.approve.se> (raw)

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.


                 reply	other threads:[~1996-09-16 12:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0v2bzP-000X3aC@lorelei.approve.se \
    --to=hoh@approve.se \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).