From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Certain pattern causing shell to crash
Date: Thu, 6 Jan 2011 19:54:27 +0000 [thread overview]
Message-ID: <20110106195427.03ab19a9@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20110106185134.GA10630@alpha.rzhou.org>
On Thu, 6 Jan 2011 13:51:35 -0500
Ricky Zhou <ricky@rzhou.org> wrote:
> For what it's worth, I did a git bisect, and the segfault was introduced
> in d234059b1c6493e5eefb6c28aa2b8a021d894d51. Hopefully this can be of
> use to somebody more familiar with how this code works.
(Ah, so I need to use
git diff d234059b1c6493e5eefb6c28aa2b8a021d894d51^\!
to look at it. Obvious.)
Yes, that narrows it down a lot, thanks.
Index: Src/text.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/text.c,v
retrieving revision 1.26
diff -p -u -r1.26 text.c
--- Src/text.c 14 Sep 2010 14:46:26 -0000 1.26
+++ Src/text.c 6 Jan 2011 19:43:49 -0000
@@ -785,8 +785,7 @@ gettext2(Estate state)
taddstr(" ");
taddstr(ecgetstr(state, EC_NODUP, NULL));
if (ctype == COND_STREQ ||
- ctype == COND_STRNEQ ||
- ctype == COND_REGEX)
+ ctype == COND_STRNEQ)
state->pc++;
} else {
/* Unary test: `-f foo' etc. */
Index: Test/C02cond.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v
retrieving revision 1.27
diff -p -u -r1.27 C02cond.ztst
--- Test/C02cond.ztst 10 Oct 2010 00:05:25 -0000 1.27
+++ Test/C02cond.ztst 6 Jan 2011 19:43:49 -0000
@@ -306,6 +306,21 @@ F:Failures in these cases do not indicat
2:Error message for unknown infix condition
?(eval):1: unknown condition: -fail
+ crashme() {
+ if [[ $1 =~ ^http:* ]]
+ then
+ url=${1#*=}
+ fi
+ }
+ which crashme
+0:Regression test for examining code with regular expression match
+>crashme () {
+> if [[ $1 =~ ^http:* ]]
+> then
+> url=${1#*=}
+> fi
+>}
+
%clean
# This works around a bug in rm -f in some versions of Cygwin
chmod 644 unmodish
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next prev parent reply other threads:[~2011-01-06 20:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 16:08 Raghavendra D Prabhu
2011-01-06 18:22 ` Peter Stephenson
2011-01-06 18:51 ` Ricky Zhou
2011-01-06 19:54 ` Peter Stephenson [this message]
2011-01-06 20:23 ` Mikael Magnusson
2011-01-07 20:35 ` Phil Pennock
2011-01-08 20:10 ` Peter Stephenson
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=20110106195427.03ab19a9@pws-pc.ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/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).