summaryrefslogtreecommitdiffstats
path: root/Src
diff options
context:
space:
mode:
authorHeon Jeong <blmarket@gmail.com>2025-10-25 20:19:48 -0700
committerOliver Kiddle <opk@zsh.org>2025-11-12 12:11:50 +0100
commit37a1e4af7ddf28c8d27db0368d1810fcda96dae1 (patch)
tree7198fdcd2c1a4cfbbed4e6f9098e34983d01f5d3 /Src
parent54026: update uscan options (diff)
downloadzsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar.gz
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar.bz2
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar.lz
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar.xz
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.tar.zst
zsh-37a1e4af7ddf28c8d27db0368d1810fcda96dae1.zip
54008: infinite loop running completion with specific multibyte character and locale combination
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/compmatch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index b58bd1f05..bc82ff4d0 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -2487,10 +2487,12 @@ join_psfx(Cline ot, Cline nt, Cline *orest, Cline *nrest, int sfx)
/* We first get the length of the prefix equal in both strings. */
if (o->flags & CLF_LINE) {
- if ((len = sub_match(&md, o->line, o->llen, sfx)) != o->llen) {
+ if ((len = sub_match(&md, o->line, o->llen, sfx)) != o->llen
+ && len >= 0) {
join = 1; line = 1; slen = &(o->llen); sstr = &(o->line);
}
- } else if ((len = sub_match(&md, o->word, o->wlen, sfx)) != o->wlen) {
+ } else if ((len = sub_match(&md, o->word, o->wlen, sfx)) != o->wlen
+ && len >= 0) {
if (o->line) {
memcpy(&md, &omd, sizeof(struct cmdata));
o->flags |= CLF_LINE | CLF_DIFF;