From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24837 invoked from network); 21 Apr 2008 10:11:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Apr 2008 10:11:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 31721 invoked from network); 21 Apr 2008 10:11:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Apr 2008 10:11:31 -0000 Received: (qmail 26530 invoked by alias); 21 Apr 2008 10:11:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24855 Received: (qmail 26510 invoked from network); 21 Apr 2008 10:11:29 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 21 Apr 2008 10:11:29 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id BF643808A389 for ; Mon, 21 Apr 2008 12:11:25 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly17g.srv.mailcontrol.com (MailControl) with ESMTP id m3LAAx9W002681 for ; Mon, 21 Apr 2008 11:11:20 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 21 Apr 2008 11:11:07 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m3LAB7dS015542 for ; Mon, 21 Apr 2008 11:11:07 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m3LAB7BA015539 for ; Mon, 21 Apr 2008 11:11:07 +0100 Message-Id: <200804211011.m3LAB7BA015539@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: completing in the middle of the command line causes coredump In-reply-to: References: Comments: In-reply-to "Jun T." message dated "Mon, 21 Apr 2008 18:56:55 +0900." Date: Mon, 21 Apr 2008 11:11:07 +0100 From: Peter Stephenson X-OriginalArrivalTime: 21 Apr 2008 10:11:07.0629 (UTC) FILETIME=[03ED29D0:01C8A398] X-Scanned-By: MailControl A-08-00-04 (www.mailcontrol.com) on 10.71.0.127 X-Virus-Scanned: ClamAV 0.91.2/6861/Mon Apr 21 09:50:29 2008 on bifrost X-Virus-Status: Clean "Jun T." wrote: > zsh (the latest CVS) coredumps while completing in the middle of the command > line. > > zleline is NULL because the command line is metafied. Yes, I wasn't careful enough with the tests. We need to delay the checks until we get back to an unmetafied command line. I've been dreaming about a proper interface between completion and the rest of the shell, most particularly the main line editor so we can trap inserts, deletions and replacements properly. Index: Src/Zle/zle_utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_utils.c,v retrieving revision 1.50 diff -u -r1.50 zle_utils.c --- Src/Zle/zle_utils.c 20 Apr 2008 21:25:28 -0000 1.50 +++ Src/Zle/zle_utils.c 21 Apr 2008 10:08:58 -0000 @@ -591,6 +591,7 @@ { int i; + UNMETACHECK(); if (flags & CUT_RAW) { i = (zlecs -= ct); } else { @@ -611,6 +612,7 @@ { int i = zlecs; + UNMETACHECK(); if (!(flags & CUT_RAW)) { int n = ct; while (n--) @@ -633,6 +635,7 @@ shiftchars(zlemetacs -= ct, ct); } else { shiftchars(zlecs -= ct, ct); + CCRIGHT(); } } else { int n = ct, origcs = zlecs; @@ -640,8 +643,8 @@ while (n--) DECCS(); shiftchars(zlecs, origcs - zlecs); + CCRIGHT(); } - CCRIGHT(); } /**/ @@ -653,6 +656,7 @@ shiftchars(zlemetacs, ct); } else if (flags & CUT_RAW) { shiftchars(zlecs, ct); + CCRIGHT(); } } else { int origcs = zlecs; @@ -663,8 +667,8 @@ ct = zlecs - origcs; zlecs = origcs; shiftchars(zlecs, ct); + CCRIGHT(); } - CCRIGHT(); } /**/ @@ -672,7 +676,8 @@ setline(char *s, int flags) { char *scp; - + + UNMETACHECK(); if (flags & ZSL_COPY) scp = ztrdup(s); else -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070