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

Re: Bug in printing of PS4 (the xtrace prompt)



Bart Schaefer wrote:

> I happened to have xtrace set while running compinit.  Here's the tail of
> the output:
> 
> +compdump:89> print
> +compdump:91> unfunction compdump
> +\M-^H\M-9'^H0\M-4\n@^P:92> autoload -U compdump
> +compinit:377> unfunction compinit
> +(^^]^H0\M-4\n@^P:378> autoload -U compinit
> 
> Looks like it's using a garbaged string as the function name after the
> function unfunctions itself.

I think it's that easy. There is another `scriptname = ...' in init.c
for sourced files -- we shouldn't need a dupstring() there, should we?

Bye
 Sven

--- os/exec.c	Tue Jul 20 08:54:10 1999
+++ Src/exec.c	Tue Jul 20 10:43:17 1999
@@ -2922,7 +2922,7 @@
 
 	tab = pparams;
 	oldscriptname = scriptname;
-	scriptname = name;
+	scriptname = dupstring(name);
 	oldzoptind = zoptind;
 	zoptind = 1;
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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