zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Madhu <enometh@meer.net>
Cc: "Lawrence Velázquez" <larryv@zsh.org>,
	"Zsh hackers list" <zsh-workers@zsh.org>
Subject: Re: PATCH: pattern incremental search
Date: Thu, 31 Mar 2022 20:49:10 -0700	[thread overview]
Message-ID: <CAH+w=7bHbuX=LwrcVok35veVY9uqhD9uW2A4NXrJQ5cWWA1+CQ@mail.gmail.com> (raw)
In-Reply-To: <20220401.075520.1210015109905370739.enometh@meer.net>

On Thu, Mar 31, 2022 at 7:26 PM Madhu <enometh@meer.net> wrote:
>
> No. I scanned the git commit, it probably fixes the bug introduced in
> "49658: Fix NULL reference in match code." but since it doesn't touch
> the code path for the case where zsh is built without multibyte, it
> don't believe it addresses the problem I raised at all.

The following appears to fix the crash problem.  I don't know what
else the rest of the patch in workers/49781 accomplishes.

diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index d9d9503e2..c8c6f78c6 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -255,7 +255,9 @@ int cost;
 #endif

 static const REFRESH_ELEMENT zr_cr = { ZWC('\r'), 0 };
+#ifdef MULTIBYTE_support
 static const REFRESH_ELEMENT zr_dt = { ZWC('.'), 0 };
+#endif
 static const REFRESH_ELEMENT zr_nl = { ZWC('\n'), 0 };
 static const REFRESH_ELEMENT zr_sp = { ZWC(' '), 0 };
 static const REFRESH_ELEMENT zr_zr = { ZWC('\0'), 0 };
diff --git a/Src/glob.c b/Src/glob.c
index 349862531..63939fea8 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -3355,7 +3355,7 @@ igetmatch(char **sp, Patprog p, int fl, int n,
char *replstr,
            /* longest or smallest at start with substrings */
            t = s;
            if (fl & SUB_GLOBAL) {
-               imd.repllist = newlinklist();
+               imd.repllist = (fl & SUB_LIST) ? znewlinklist() : newlinklist();
                if (repllistp)
                    *repllistp = imd.repllist;
            }


  reply	other threads:[~2022-04-01  4:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-26 19:41 Peter Stephenson
2008-04-26 20:22 ` Peter Stephenson
2008-04-26 20:35   ` Peter Stephenson
2008-04-26 20:51     ` Peter Stephenson
2008-04-26 23:52 ` Bart Schaefer
2008-04-28  1:35 ` Geoff Wing
     [not found] ` <CAHYJk3Q5x=5Zn5kURXDDgLLoSEsro45_G=SZB-P+qX_qk7dn-Q@mail.gmail.com>
2021-12-20  3:40   ` Mikael Magnusson
2021-12-20 12:10     ` Peter Stephenson
2022-02-28 16:54       ` Madhu
2022-03-31 22:44         ` Lawrence Velázquez
2022-04-01  2:25           ` Madhu
2022-04-01  3:49             ` Bart Schaefer [this message]
2022-04-01 18:23               ` Bart Schaefer

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='CAH+w=7bHbuX=LwrcVok35veVY9uqhD9uW2A4NXrJQ5cWWA1+CQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=enometh@meer.net \
    --cc=larryv@zsh.org \
    --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).