From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: zsh-workers@sunsite.dk
Subject: Re: crash in completing code with unicode support
Date: Thu, 18 Aug 2005 20:35:14 +0400 [thread overview]
Message-ID: <200508182035.15211.arvidjaar@newmail.ru> (raw)
In-Reply-To: <20050816214959.GB5904@blorf.net>
[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]
On Wednesday 17 August 2005 01:49, Wayne Davison wrote:
> On Tue, Aug 16, 2005 at 02:37:13PM -0700, Wayne Davison wrote:
> > If the above is right, then this line should probably be changed to be:
> >
> > if (p == compprefix + l + (*compprefix == Meta))
>
Of course I went blind.
The patch adds check for EOS, it intentionally leaves pointer at the end to
let ztrsub() complaint later.
Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.29
diff -u -p -r1.29 complete.c
--- Src/Zle/complete.c 16 Aug 2005 21:49:33 -0000 1.29
+++ Src/Zle/complete.c 18 Aug 2005 16:30:36 -0000
@@ -821,6 +821,8 @@ do_comp_vars(int test, int na, char *sa,
add = -1;
} else {
p = compprefix + 1 + (*compprefix == Meta);
+ if (p > compprefix + l)
+ p = compprefix + l;
add = 1;
}
for (;;) {
@@ -833,10 +835,9 @@ do_comp_vars(int test, int na, char *sa,
if (add > 0) {
if (p == compprefix + l)
return 0;
- if (*p == Meta)
- p += 2;
- else
- p++;
+ p = p + 1 + (*p == Meta);
+ if (p > compprefix + l)
+ p = compprefix + l;
} else {
if (p == compprefix)
return 0;
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-08-18 16:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-16 1:37 Mikael Magnusson
2005-08-16 7:57 ` Andrey Borzenkov
2005-08-16 11:44 ` Clint Adams
2005-08-16 12:09 ` Nikolai Weibull
2005-08-16 16:16 ` Andrey Borzenkov
2005-08-18 9:34 ` Peter Stephenson
2005-08-16 12:01 ` Mikael Magnusson
2005-08-16 19:27 ` Andrey Borzenkov
2005-08-16 21:37 ` Wayne Davison
2005-08-16 21:49 ` Wayne Davison
2005-08-17 0:22 ` crash fixed, other minor issue though was: " Mikael Magnusson
2005-08-18 16:48 ` Andrey Borzenkov
2005-08-18 16:35 ` Andrey Borzenkov [this message]
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=200508182035.15211.arvidjaar@newmail.ru \
--to=arvidjaar@newmail.ru \
--cc=zsh-workers@sunsite.dk \
/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).