zsh-workers
 help / color / mirror / code / Atom feed
* Bug in recursive function calls, source and exit
@ 2005-12-02 22:09 Vincent Lefevre
  2005-12-03  0:09 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2005-12-02 22:09 UTC (permalink / raw)
  To: zsh-workers

Hi,

In a French mailing-list, I've just heard of a bug related to
recursive function calls, source and exit; I don't think it has
been reported yet. Here's a way to reproduce it:

dixsept:~> zsh-beta -f
dixsept% echo $ZSH_VERSION 
4.3.0-dev-1
dixsept% echo false > ./file
dixsept% f() {
function> echo $[++i]
function> cat file
function> sleep 1
function> . ./file || echo exit > ./file
function> f
function> }
dixsept% which f
f () {
        echo $[++i]
        cat file
        sleep 1
        . ./file || echo exit > ./file
        f
}
dixsept% f
1
false
2
exit
3
exit
4
exit
5
exit
6
exit
[Ctrl-C]
dixsept:~>

FYI, bash doesn't have this problem:

[...]
vlefevre@dixsept:~$ f
1
false
2
exit
dixsept:~>

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-03  0:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02 22:09 Bug in recursive function calls, source and exit Vincent Lefevre
2005-12-03  0:09 ` Peter Stephenson

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).