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) with ESMTP id LAA10050 for ; Wed, 15 May 1996 11:54:20 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id VAA28222; Tue, 14 May 1996 21:39:44 -0400 (EDT) Resent-Date: Tue, 14 May 1996 21:39:44 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199605150138.DAA01834@hzoli.ppp.cs.elte.hu> Subject: More 8-bit zle changes To: zsh-workers@math.gatech.edu (Zsh hacking and development) Date: Wed, 15 May 1996 03:38:58 +0200 (MET DST) X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: 7bit Resent-Message-ID: <"x6fnu1.0.ru6.VNJcn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1072 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This patch fixes insertlastword, pushline, pushlineoredit, getline, acceptandinfernexthistory, virepeatsearch and acceptline. Zoltan *** Src/zle_hist.c 1996/05/15 00:33:04 2.11 --- Src/zle_hist.c 1996/05/15 01:30:31 *************** *** 490,498 **** lasthist = evhist; lastpos = cs; lastinsert = ztrdup(s); ! spaceinline(len = strlen(s)); ! memcpy((char *)line + cs, s, len); ! cs += len; *t = save; } --- 490,500 ---- lasthist = evhist; lastpos = cs; lastinsert = ztrdup(s); ! spaceinline(len = ztrlen(s)); ! while (len--) { ! line[cs++] = *s == Meta ? *++s ^ 32 : *s; ! s++; ! } *t = save; } *************** *** 527,533 **** { if (mult < 0) return; ! pushnode(bufstack, ztrdup(UTOSCP(line))); while (--mult) pushnode(bufstack, ztrdup("")); stackcs = cs; --- 529,535 ---- { if (mult < 0) return; ! pushnode(bufstack, metafy(UTOSCP(line), ll, META_DUP)); while (--mult) pushnode(bufstack, ztrdup("")); stackcs = cs; *************** *** 540,556 **** pushlineoredit(void) { int ics; ! char *iline, *hline = hgetline(); if (mult < 0) return; if (hline && *hline) { ! ics = strlen(hline); ! iline = (char *)zalloc(ll + ics + 1); ! strcpy(iline, hline); ! strcat(iline, (char *)line); ! free(line); ! line = (unsigned char *)iline; ll += ics; cs += ics; } --- 542,558 ---- pushlineoredit(void) { int ics; ! unsigned char *s; ! char *hline = hgetline(); if (mult < 0) return; if (hline && *hline) { ! ics = ztrlen(hline); ! sizeline(ics + ll + 1); ! for (s = line + ll; --s >= line; *(s + ics) = *s); ! for (s = line; *hline; hline++) ! *s++ = *hline == Meta ? *++hline ^ 32 : *hline; ll += ics; cs += ics; } *************** *** 582,592 **** else { int cc; ! cc = strlen(s); spaceinline(cc); memcpy((char *)line + cs, s, cc); cs += cc; ! zsfree(s); } } --- 584,594 ---- else { int cc; ! unmetafy(s, &cc); spaceinline(cc); memcpy((char *)line + cs, s, cc); cs += cc; ! free(s); } } *************** *** 867,873 **** for (t0 = histline - 2;; t0--) { if (!(s = qgetevent(t0))) return; ! if (!strncmp(s, UTOSCP(line), ll)) break; } if (!(s = qgetevent(t0 + 1))) --- 869,875 ---- for (t0 = histline - 2;; t0--) { if (!(s = qgetevent(t0))) return; ! if (!metadiffer(s, UTOSCP(line), ll)) break; } if (!(s = qgetevent(t0 + 1))) *************** *** 1057,1063 **** histline = ohistline; return; } ! if (!strcmp(UTOSCP(line), s)) continue; if (*visrchstr == '^') { if (!strncmp(s, visrchstr + 1, t0 - 1)) --- 1059,1065 ---- histline = ohistline; return; } ! if (!metadiffer(s, UTOSCP(line), ll)) continue; if (*visrchstr == '^') { if (!strncmp(s, visrchstr + 1, t0 - 1)) *** Src/zle_misc.c 1996/05/10 21:01:56 2.12 --- Src/zle_misc.c 1996/05/14 23:54:41 *************** *** 263,269 **** void acceptandhold(void) { ! pushnode(bufstack, ztrdup((char *)line)); stackcs = cs; done = 1; } --- 263,269 ---- void acceptandhold(void) { ! pushnode(bufstack, metafy((char *)line, ll, META_DUP)); stackcs = cs; done = 1; } -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBMZk1sQupSCiLN749AQE/GwP/Xtj/z96NPBIf+DaVifFH8Q2aWNbWxkC1 s6TsD3+AxrRQ7q7+8FDDo/wb8twOYhgwA3+M+GIJIZww40IzXZt4AYYuzbu2ExIZ 0zHTEr02/+ne57RtX/UPaX6UXgwgEO9mz56utJgnoptZQ+p75K9JrdqV7fN+rnzr 1uk+Gh+rLnA= =BXaB -----END PGP SIGNATURE-----