[Pkg-zsh-devel] Bug#1035679: zsh: can misprocess continue in a loop

brian m. carlson sandals at crustytoothpaste.net
Sun May 7 18:18:05 BST 2023


Package: zsh
Version: 5.9-4+b1
Severity: normal
Tags: patch

If a continue occurs in an && chain inside a loop, the continue is not
effective.  For example, if you save the following as foo.sh:

----
msg=unset
for x in 1 2 3 4 5; do
  continue && msg=set && print Not executed
  print Not executed, neither.
done
echo $msg
----

The output should be "unset", but zsh prints "set":

----
$ bash foo.sh
unset
$ dash foo.sh
unset
$ zsh foo.sh
set
----

This breaks the Git testsuite under zsh's sh mode, which was formerly
passing.

There's a patch upstream at
https://github.com/zsh-users/zsh/commit/12e5db145b098a62ff11b88eea26f473ea2ecdcf.
It would be great if this could be backported to zsh in Debian, since
the release cycle tends to be long and it prevents the shell from being
effectively used as a POSIX sh.

-- Package-specific info:

Packages which provide vendor completions:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version             Architecture Description
+++-=================-===================-============-=======================================================================
ii  alacritty         0.11.0-4            amd64        Fast, cross-platform, OpenGL terminal emulator
ii  bubblewrap        0.8.0-2             amd64        utility for unprivileged chroot and namespace manipulation
ii  containerd        1.6.20~ds1-1+b1     amd64        open and reliable container runtime
ii  curl              7.88.1-9            amd64        command line tool for transferring data with URL syntax
ii  docker.io         20.10.24+dfsg1-1+b2 amd64        Linux container runtime
ii  dpkg-dev          1.21.21             all          Debian package development tools
ii  gh                2.23.0+dfsg1-1      amd64        GitHub CLI, GitHub’s official command line tool
ii  pulseaudio-utils  16.1+dfsg1-2+b1     amd64        Command line tools for the PulseAudio sound server
ii  qpdf              11.3.0-1            amd64        tools for transforming and inspecting PDF files
ii  systemd           252.6-1             amd64        system and service manager
ii  systemd-container 252.6-1             amd64        systemd container/nspawn tools
ii  systemd-resolved  252.6-1             amd64        systemd DNS resolver
ii  tmuxinator        3.0.5-1             all          Create and manage tmux sessions easily
ii  udev              252.6-1             amd64        /dev/ and hotplug management daemon
ii  vagrant           2.3.4+dfsg-1        all          Tool for building and distributing virtualized development environments
ii  vlc-bin           3.0.18-2            amd64        binaries from VLC

The following files were modified:

/etc/systemd/resolved.conf

dpkg-query: no path found matching pattern /usr/share/zsh/vendor-functions/


-- System Information:
Debian Release: 12.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-6-amd64 (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER, TAINT_WARN
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages zsh depends on:
ii  debianutils  5.7-0.4
ii  libc6        2.36-9
ii  libcap2      1:2.66-3
ii  libtinfo6    6.4-2
ii  zsh-common   5.9-4

Versions of packages zsh recommends:
ii  libc6         2.36-9
ii  libgdbm6      1.23-3
ii  libncursesw6  6.4-2
ii  libpcre3      2:8.39-15

Versions of packages zsh suggests:
pn  zsh-doc  <none>

-- no debconf information

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20230507/a76544ea/attachment.sig>


More information about the Pkg-zsh-devel mailing list