#1122569 zsh: With RC_EXPAND_PARAM, s:string: does not elide an empty field

Package:
zsh
Source:
zsh
Description:
shell with lots of features
Submitter:
Vincent Lefevre
Date:
2025-12-16 13:43:04 UTC
Severity:
normal
Tags:
#1122569#5
Date:
2025-12-11 12:22:17 UTC
From:
To:
The zshexpn(1) man page says:

  s:string:
[...]
    For historical reasons, the usual behaviour that  empty  array
    elements  are  retained  inside  double quotes is disabled for
    arrays generated by splitting; hence the following:

            line="one::three"
            print -l "${(s.:.)line}"

    produces two lines of output for one and three and elides  the
    empty  field.   To  override  this behaviour, supply the `(@)'
    flag as well, i.e.  "${(@s.:.)line}".

But without the (@) flag, if the RC_EXPAND_PARAM option is set,
this does not elide the empty field:

cventin% line="one::three" ; print -l "${(s.:.)line}"
one
three
cventin% setopt RC_EXPAND_PARAM
cventin% line="one::three" ; print -l "${(s.:.)line}"
one

three
cventin%

#1122569#10
Date:
2025-12-11 23:28:17 UTC
From:
To:
Hi,

* Vincent Lefevre [Thu Dec 11, 2025 at 01:22:17PM +0100]:
[...]

Thanks for reporting this towards upstream.

Is there any specific reason why we should track this - AFAICT
very minor issue - also within Debian's BTS?

I'm asking, because our list of open bugs at
https://bugs.debian.org/zsh is already quite long, as you might be
aware of, and AFAICS ~32 of those bug reports got submitted by you.

The current maintainers of pkg-zsh are quite overloaded already, so
any assistance in improving the actual situation would be very
welcome. Given your track record, maybe you wanna join us? :)

regards
-mika-

#1122569#15
Date:
2025-12-12 02:05:17 UTC
From:
To:
The issue is that upstream does not have a bug tracker, and
this makes difficult to know which versions are affected,
and which bugs need to be tested to check whether they are
still there in Debian.

Note that though this bug probably occurs very rarely, it can
introduce obscure incorrect behavior in scripts.

I check old bugs from time to time (in particular when there
are new versions of packages, but which hasn't happened for a
long time concerning zsh).

#1122569#20
Date:
2025-12-16 13:34:10 UTC
From:
To:
Vincent Lefevre wrote on Fri, 12 Dec 2025 02:05 +00:00:

Upstream does have the Etc/BUGS file to track bugs in.  Why don't you
help maintain it?

Or if you want to help upstream set up some less-barebones bug tracker,
something that can track "affected versions" metadata too, I'm sure
upstream's -workers@ and -infra@ would be happy to have you on board.

Cheers,

Daniel
(upstream hat on)