Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Segfault in completion code
- X-seq: zsh-workers 18916
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Segfault in completion code
- Date: Thu, 31 Jul 2003 21:33:17 +0100
- In-reply-to: "Haakon Riiser"'s message of "Sun, 27 Jul 2003 03:42:10 +0200." <20030727014210.GA11368@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Haakon Riiser wrote:
> Steps to reproduce:
>
> % unset IFS
> % <try to perform any type of completion>
> zsh: segmentation fault zsh
This fixes a problem, is it the one you came across?
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.51
diff -u -r1.51 utils.c
--- Src/utils.c 13 May 2003 12:50:32 -0000 1.51
+++ Src/utils.c 31 Jul 2003 20:25:36 -0000
@@ -2054,10 +2054,12 @@
if (!*s)
return heap ? "" : ztrdup("");
if (!sep) {
- sep = sepbuf;
- sepbuf[0] = *ifs;
- sepbuf[1] = *ifs == Meta ? ifs[1] ^ 32 : '\0';
- sepbuf[2] = '\0';
+ p = sep = sepbuf;
+ if (ifs) {
+ *p++ = *ifs;
+ *p++ = *ifs == Meta ? ifs[1] ^ 32 : '\0';
+ }
+ *p = '\0';
}
sl = strlen(sep);
for (t = s, l = 1 - sl; *t; l += strlen(*t) + sl, t++);
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk
Messages sorted by:
Reverse Date,
Date,
Thread,
Author