From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: Re: completion matching problem with 4.3.8
Date: Thu, 30 Oct 2008 20:21:58 +0000 [thread overview]
Message-ID: <20081030202158.5692e313@pws-pc> (raw)
In-Reply-To: <19187.1225381420@thecus>
On Thu, 30 Oct 2008 16:43:40 +0100
Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Anyway, the gcc built zsh also has the problem so it isn't compiler
> related. I tried running the minimal zsh -f, compctl test on Linux
> through valgrind and I get the following message. Maybe valgrind has
> found the source of the problem:
>...
> Valgrind also finds some leaked memory from parse_class (complete.c:467)
> with the same test.
This should keep valgrind happy. I can't see any way these changes can
be wrong, but I've said that before.
Unfortunately, when I do this, the original problem (showing too many
characters in an ambiguous completion) now crops up. This will take
*massively* more time to fix than the hour and a half I've spent so far.
Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.42
diff -u -r1.42 complete.c
--- Src/Zle/complete.c 23 Sep 2008 19:33:26 -0000 1.42
+++ Src/Zle/complete.c 30 Oct 2008 20:14:21 -0000
@@ -464,7 +464,7 @@
* As the input string is metafied, but shouldn't contain shell
* tokens, we can just add our own tokens willy nilly.
*/
- optr = p->u.str = zalloc((optr-iptr) + 1);
+ optr = p->u.str = zhalloc((optr-iptr) + 1);
while (firsttime || *iptr != endchar) {
int ch;
Index: Src/Zle/compmatch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v
retrieving revision 1.59
diff -u -r1.59 compmatch.c
--- Src/Zle/compmatch.c 12 Oct 2008 19:28:10 -0000 1.59
+++ Src/Zle/compmatch.c 30 Oct 2008 20:14:22 -0000
@@ -1687,6 +1687,7 @@
llen = mp->llen;
rl = 0;
+ *line = '\0';
if (sfx)
{
/*
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next prev parent reply other threads:[~2008-10-30 20:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 11:28 Oliver Kiddle
2008-10-30 12:17 ` Peter Stephenson
2008-10-30 13:13 ` Oliver Kiddle
2008-10-30 14:11 ` Peter Stephenson
2008-10-30 15:05 ` Oliver Kiddle
2008-10-30 15:43 ` Oliver Kiddle
2008-10-30 20:21 ` Peter Stephenson [this message]
2008-10-30 22:00 ` Peter Stephenson
2008-10-31 9:08 ` Oliver Kiddle
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=20081030202158.5692e313@pws-pc \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@sunsite.dk \
/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).