From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: Segfault in completion code
Date: Thu, 31 Jul 2003 21:33:17 +0100 [thread overview]
Message-ID: <20030731203319.86ACF8548@pwstephenson.fsnet.co.uk> (raw)
In-Reply-To: "Haakon Riiser"'s message of "Sun, 27 Jul 2003 03:42:10 +0200." <20030727014210.GA11368@s.chello.no>
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@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk
next prev parent reply other threads:[~2003-07-31 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-27 1:42 Haakon Riiser
2003-07-31 20:33 ` Peter Stephenson [this message]
2003-07-31 21:33 ` Haakon Riiser
2003-08-01 10:58 ` Peter Stephenson
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=20030731203319.86ACF8548@pwstephenson.fsnet.co.uk \
--to=pws@pwstephenson.fsnet.co.uk \
--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).