From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 73d190f0 for ; Fri, 3 May 2019 18:09:06 +0000 (UTC) Received: (qmail 5786 invoked by alias); 3 May 2019 18:08:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44270 Received: (qmail 17222 invoked by uid 1010); 3 May 2019 18:08:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f176.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25434. spamassassin: 3.4.2. Clear:RC:0(209.85.166.176):SA:0(-2.0/5.0):. Processed in 2.111431 secs); 03 May 2019 18:08:55 -0000 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.176 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gElPa3SRvPJpsNIhLT0x3oBZbUXSA3DWw29l9xvaXVw=; b=fP9hDseeOFVPuOoyqMAYBj/ZY3c3R5bsu6cERIq/cgurlxp8GiW24+YSSkV2Qa2rhi A6eSu7KGZm3jnG2Ci2wdl7xFa4NELXmNgyExn2QCbk7yNb6aewJyrzIFDEkhnmv+SOER 1NPeqpcM+S4hxsnELsOepSmsVfOWd4uMhCNm6r1e/aTDB9H9Q4UGSU4hVmHbzvnbr/wX UZmfyAJEZ9YhyzTwZBnrYfvj8YyXaTpzLGeyNlVYGpCti6viVm0d1Ghph4UXDfJEte0c 7I2cJnowie+bfstl/vBrKsEFaACC1xgm23bYyCnD5hQxUeKwpbe1qNZCwF+AZUNN8gXX PZFw== X-Gm-Message-State: APjAAAWBnv8JOb4aZhH/Sp5xGcLIw1QND1RzcDYjkdg11V8sDlfJSHqh ZZiZR+K+EaV18qnyAfL179vFwYMLrqEu8en8ISbzDA== X-Google-Smtp-Source: APXvYqwlWnOQs1vGRb4VsNvdgKQWnZIh5jp0nHCq6oY0y3GGKj7SZ9ncR2PAZLO61w296T/19HqxaWPmGr0OFU9PgSQ= X-Received: by 2002:a24:7c9:: with SMTP id f192mr8120359itf.97.1556906899122; Fri, 03 May 2019 11:08:19 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Mikael Magnusson Date: Fri, 3 May 2019 20:08:18 +0200 Message-ID: Subject: Re: [BUG] program flow corruption involving dot script and 'until' loop To: Martijn Dekker Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On 5/3/19, Martijn Dekker 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