Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: pattern incremental search



On Thu, Mar 31, 2022 at 7:26 PM Madhu <enometh@xxxxxxxx> 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;
            }




Messages sorted by: Reverse Date, Date, Thread, Author