Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] program flow corruption involving dot script and 'until' loop
- X-seq: zsh-workers 44270
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Martijn Dekker <martijn@xxxxxxxx>
- Subject: Re: [BUG] program flow corruption involving dot script and 'until' loop
- Date: Fri, 3 May 2019 20:08:18 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gElPa3SRvPJpsNIhLT0x3oBZbUXSA3DWw29l9xvaXVw=; b=bmGDwiz3Bc+bu+CPlgDhiWLuNECjfB0/80jEqA6CkdNzAoYZoCNwQuEo/rlRyc7B6K ywew/XviUb0Xlsf+/WLmc39QtB2n3A4bWNeOwHhepivzTxrHhAB4h01M6nFnZqlAsPES GtIzX+sR759QnmazTOqDs/hOpyDYOlglqAZNb9n+hy81znNbuGg+0Vu0ZezN3uHQYCMN 0D9x4IFQJLvbQBangWPos+x8ZD29TZp7Q24JmGvp7WN4Cc9ARLykl5Ed6R7uwJdKP4bZ i+joN7c3zGqTI8tL2IQ92LN/0vHn+gk86Rqw9ye0dqnjvK+vKpCF19yuysEZ1dlhN0zE IB+Q==
- In-reply-to: <bc4ab83e-2eb0-6737-1f2c-3530e508b68c@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <bc4ab83e-2eb0-6737-1f2c-3530e508b68c@inlv.org>
On 5/3/19, Martijn Dekker <martijn@xxxxxxxx> wrote:
> ===begin test.sh===
> #! /bin/sh
> fn() {
> echo beginfn
> . ./dot.sh
> echo endfn$?
> }
> echo begin
> fn
> echo end
> ===end test.sh===
>
> ===begin dot.sh===
> #! /bin/sh
> echo dot
> until return 42; do
> :
> done
> ===end dot.sh===
>
> Actual output:
> $ zsh test.sh
> begin
> beginfn
> dot
>
> Expected output:
> $ zsh test.sh
> begin
> beginfn
> dot
> endfn42
> end
>
> Looks like the 'return' in the dot script causes zsh to just give up on
> the program altogether.
>
> If 'return 42' is changed to 'return' in dot.sh, the bug disappears. If
> it is changed to '(exit 42); return', the bug re-appears.
>
> I've tested zsh versions down to 5.0.6; they all act identically.
If I run this interactively
. =(echo until return 1\; do done)
it returns 1 immediately but I am no longer able to invoke any user
widgets (which in my case is both self-insert and accept-line, so it
is quite limiting :).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author