* Possible zle_tricky.c memory leak & history typo
@ 2000-06-26 6:45 Felix Rosencrantz
0 siblings, 0 replies; 2+ messages in thread
From: Felix Rosencrantz @ 2000-06-26 6:45 UTC (permalink / raw)
To: zsh-workers
There are several typos in the latest changes to the history completers.
The last line of the completer looks like:
(( $compstate[namtches] ))
I don't think the "$" sign is needed, (_history_complete_word, also has this
problem then.) Also, the "am" need to be switched in "namtches".
I've been tight on time, otherwise I would send the patch or make the change
myself. (if no one fixes this, i'll fix it when i get time.)
Also, there was (and might still be) a memory leak in the version of
zle_tricky.c from June 9th. Below is the stack trace where the memory is
allocated. (The line numbers are from the june 10th version. Sorry not to use
the current version). I think the bug might be at line 607, where s is not
freed before we return.
zalloc [mem.c:453]
ztrdup [mem.c:530]
get_comp_string [zle_tricky.c:1595]
docomplete [zle_tricky.c:586]
expandorcomplete [zle_tricky.c:282]
-FR
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Possible zle_tricky.c memory leak & history typo
@ 2000-06-26 8:18 Sven Wischnowsky
0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-06-26 8:18 UTC (permalink / raw)
To: zsh-workers
Felix Rosencrantz wrote:
> There are several typos in the latest changes to the history completers.
> The last line of the completer looks like:
> (( $compstate[namtches] ))
This was only in _history, not in _h_c_w. Several, you say,... what else?
> I don't think the "$" sign is needed, (_history_complete_word, also has this
> problem then.) Also, the "am" need to be switched in "namtches".
The $ isn't really needed, but it doesn't do any harm either.
> I've been tight on time, otherwise I would send the patch or make the change
> myself. (if no one fixes this, i'll fix it when i get time.)
>
>
> Also, there was (and might still be) a memory leak in the version of
> zle_tricky.c from June 9th. Below is the stack trace where the memory is
> allocated. (The line numbers are from the june 10th version. Sorry not to use
> the current version). I think the bug might be at line 607, where s is not
> freed before we return.
> zalloc [mem.c:453]
> ztrdup [mem.c:530]
> get_comp_string [zle_tricky.c:1595]
> docomplete [zle_tricky.c:586]
> expandorcomplete [zle_tricky.c:282]
s and qword. Whew. That must be one of the oldest bugs in the shell.
But how did you trigger that?
Bye
Sven
Index: Completion/Core/_history
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_history,v
retrieving revision 1.4
diff -u -r1.4 _history
--- Completion/Core/_history 2000/06/22 08:42:36 1.4
+++ Completion/Core/_history 2000/06/26 08:18:18
@@ -57,4 +57,4 @@
(( beg+=slice ))
done
-(( $compstate[namtches] ))
+(( $compstate[nmatches] ))
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.16
diff -u -r1.16 zle_tricky.c
--- Src/Zle/zle_tricky.c 2000/06/19 09:55:32 1.16
+++ Src/Zle/zle_tricky.c 2000/06/26 08:18:19
@@ -604,6 +604,8 @@
ll = strlen((char *) line);
cs = ocs;
unmetafy_line();
+ zsfree(s);
+ zsfree(qword);
return 1;
}
ocs = cs;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-06-26 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-26 6:45 Possible zle_tricky.c memory leak & history typo Felix Rosencrantz
2000-06-26 8:18 Sven Wischnowsky
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).