zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-workers@sunsite.dk
Subject: Bug in recursive function calls, source and exit
Date: Fri, 2 Dec 2005 23:09:21 +0100	[thread overview]
Message-ID: <20051202220921.GR8445@ay.vinc17.org> (raw)

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


             reply	other threads:[~2005-12-02 22:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-02 22:09 Vincent Lefevre [this message]
2005-12-03  0:09 ` Peter Stephenson

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=20051202220921.GR8445@ay.vinc17.org \
    --to=vincent@vinc17.org \
    --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).