Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: pattern incremental search
- X-seq: zsh-workers 49658
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: pattern incremental search
- Date: Mon, 20 Dec 2021 12:10:34 +0000 (GMT)
- Archived-at: <https://zsh.org/workers/49658>
- Importance: Medium
- In-reply-to: <CAHYJk3TkPP3=Gmc7Tv5ted3ey7KY37yu0DSaCL4=1qqOgr0TpA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <26439.1209238907@pws-pc> <CAHYJk3Q5x=5Zn5kURXDDgLLoSEsro45_G=SZB-P+qX_qk7dn-Q@mail.gmail.com> <CAHYJk3TkPP3=Gmc7Tv5ted3ey7KY37yu0DSaCL4=1qqOgr0TpA@mail.gmail.com>
On 12/20/21, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 4/26/08, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>> - if (replstr) {
>> + if (replstr || (fl & SUB_LIST)) {
> Someone in the irc channel reported a crash on this strlen when doing
> history-incremental-pattern-search-backward with any search, and they
> can reproduce it with the latest git version too, they posted this
> backtrace:
That extra test doesn't look like it makes any sense --- I think it
may just be in completely the wrong place and shouldn't be in
get_match_ret() at all since it's similar to some checks in other
places where we allow zero-length (but not NULL) strings for some
edge cases in some variants of matching. We should probably
just remove it and see what happens.
pws
diff --git a/Src/glob.c b/Src/glob.c
index bee890caf..375671cea 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2549,7 +2549,7 @@ get_match_ret(Imatchdata imd, int b, int e)
e += add;
/* Everything now refers to metafied lengths. */
- if (replstr || (fl & SUB_LIST)) {
+ if (replstr) {
if (fl & SUB_DOSUBST) {
replstr = dupstring(replstr);
singsub(&replstr);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author