summaryrefslogtreecommitdiff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Src/Zle/compresult.c
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 30fc60b78..57789c0f3 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -612,9 +612,10 @@ instmatch(Cmatch m, int *scs)
int pcs = zlemetacs;
l = 0;
- for (bp = brbeg, brpos = m->brpl,
- bradd = (m->pre ? strlen(m->pre) : 0);
- bp; bp = bp->next, brpos++) {
+ bradd = (m->pre ? strlen(m->pre) : 0);
+ for (bp = brbeg, brpos = m->brpl;
+ bp && brpos;
+ bp = bp->next, brpos++) {
zlemetacs = a + *brpos + bradd;
pcs = zlemetacs;
l = strlen(bp->str);
@@ -1583,7 +1584,7 @@ calclist(int showall)
nlines += 1 + printfmt(m->disp, 0, 0, 0);
g->flags |= CGF_HASDL;
} else {
- l = ZMB_nicewidth(m->disp);
+ l = ZMB_nicewidth(m->disp) + !!m->modec;
ndisp++;
if (l > glong)
glong = l;
@@ -2247,15 +2248,13 @@ iprintm(Cmgroup g, Cmatch *mp, UNUSED(int mc), UNUSED(int ml), int lastc, int wi
#ifdef MULTIBYTE_SUPPORT
len = mb_niceformat(m->disp, shout, NULL, 0);
#else
- nicezputs(m->disp, shout);
- len = niceztrlen(m->disp);
+ len = sb_niceformat(m->disp, shout, NULL, 0);
#endif
} else {
#ifdef MULTIBYTE_SUPPORT
len = mb_niceformat(m->str, shout, NULL, 0);
#else
- nicezputs(m->str, shout);
- len = niceztrlen(m->str);
+ len = sb_niceformat(m->str, shout, NULL, 0);
#endif
if ((g->flags & CGF_FILES) && m->modec) {