From: Thorsten Meinecke <kaefer@aglaia.snafu.de>
To: zsh-workers@math.gatech.edu
Subject: SIGSEGV caused by global substitution modifier
Date: Thu, 6 Jul 1995 17:21:57 +0200 (MET DST) [thread overview]
Message-ID: <m0sTskY-00000PC@aglaia.snafu.DE> (raw)
Please have a look at this:
$ zsh-2.6-beta5 -Fc 'FOO=123;echo $FOO:gs//bar/'
bar
$ zsh-2.6-beta10 -fc 'FOO=123;echo $FOO:gs//bar/'
zsh: segmentation fault zsh-2.6-beta10 -fc 'FOO=123;echo $FOO:gs//bar/'
$FOO:gs/// loops forever now, which is especially unpleasant (since
not interruptible) when it occurs in completion control functions like
P.Stephenson's new `multicomp'. This is how I noticed the problem.
You might want to try `!??:gs///' on the command line, too. Don't.
An empty left-hand side of a substitution has a special meaning
("use scan string or previous match"), right? Only if there's no
non-empty scan string or previous match, the left-hand side evaluates
to a null string, and zsh chokes.
There's another (somewhat related) problem: Used on the result of
parameter expansion, empty l strings of substitution modifiers don't
produce the expected result:
$ FOO=1213
$ echo $FOO:s/1/a/:s//b/
b
I've expected `a2b3'. That is what `!:s/1/a/:s//b/' would give.
This "feature" is present at least since zsh-2.4.306-beta. Are there
any rationales behind this?
[zsh-2.6-beta10, Linux 1.2.0, libc 4.5.26, gcc 2.5.8]
--
Thorsten Meinecke
<kaefer@aglaia.snafu.de>
next reply other threads:[~1995-07-06 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-07-06 15:21 Thorsten Meinecke [this message]
1995-07-07 16:52 ` Zoltan Hidvegi
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=m0sTskY-00000PC@aglaia.snafu.DE \
--to=kaefer@aglaia.snafu.de \
--cc=zsh-workers@math.gatech.edu \
/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).