From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id HAA05650 for ; Thu, 18 Jul 1996 07:58:56 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id RAA24386; Wed, 17 Jul 1996 17:51:34 -0400 (EDT) Resent-Date: Wed, 17 Jul 1996 17:51:34 -0400 (EDT) From: "Bart Schaefer" Message-Id: <9607171452.ZM9186@candle.brasslantern.com> Date: Wed, 17 Jul 1996 14:52:38 -0700 In-Reply-To: "Bart Schaefer" "Completion behavior change in 3.0-pre3" (Jul 15, 11:00pm) References: <960715230041.ZM1638@candle.brasslantern.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (3.2.1 24feb96 Caldera) To: zsh-workers@math.gatech.edu Subject: Re: Completion behavior change in 3.0-pre3 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"TfOcU1.0.yy5.c1Mxn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1690 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 15, 11:00pm, Bart Schaefer wrote: > Subject: Completion behavior change in 3.0-pre3 > Here's zsh 3.0-pre2: > > zagzig[85] echo z*i > (feep) > zagzig[85] echo z*i > > Here's zsh 3.0-pre3: > > zagzig<3> echo z*i > (feep) > zagzig<3> echo z\*i I've traced the point where the extra backslash gets inserted into makecomplist(), right here: /* ... */ lpre = zalloc(lpl + 1); memcpy(lpre, s, lpl); lpre[lpl] = '\0'; p = quotename(lpre, NULL, NULL, NULL); if (strcmp(p, lpre) && !strpfx(p, qword)) { /* ... */ inststrlen(p, 1, l2 = strlen(p)); /* This adds the backslash */ /* ... */ } /* ... */ In 3.0-pre2 and earlier, the backslash would get removed again as shown by the following patch (which backs out two hunks of Zoltan's changes). I'm not sure why Zoltan thought the line should only be restored when going around the xorrec: loop. Should cs et.al. get restored along with the line when *not* going around the loop? (They weren't in pre2, this just puts back the pre2 behavior.) *** Src/zle_tricky.c.0 Mon Jul 15 22:46:49 1996 --- Src/zle_tricky.c Wed Jul 17 14:45:34 1996 *************** *** 2957,2962 **** --- 2957,2964 ---- validlist = 1; if(nmatches && !errflag) return 0; + /* No matches: restore the command line. */ + strcpy((char *)line, (char *)ol); if ((isf || cc->xor) && !parampre) { /* We found no matches, but there is a xor'ed completion: * *************** *** 2967,2973 **** wb = owb; we = owe; cs = ocs; - strcpy((char *)line, (char *)ol); offs = oloffs; s = dupstring(os); free(amatches); --- 2969,2974 ----