Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: weird history bug (involves unicode characters)
- X-seq: zsh-workers 25690
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: weird history bug (involves unicode characters)
- Date: Thu, 18 Sep 2008 21:33:22 +0100
- In-reply-to: <237967ef0809180515p784beb03ud7a78129089c4e2c@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0809180515p784beb03ud7a78129089c4e2c@xxxxxxxxxxxxxx>
On Thu, 18 Sep 2008 14:15:12 +0200
"Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
> zsh -f<enter>
> : ト<enter>
> <alt-.>
> #this brings back the ト
> <ctrl-c>
> <uparrow>
>
> only the colon appears, and alt-. also stops working completely
I can't work out why no one else sees these problems...
I should never have made stringaszleline() modify the string in place.
It was supposed to be more efficient but I keep forgetting. I should
perhaps make it a flag which should be enough to remind me.
Index: Src/Zle/zle_hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v
retrieving revision 1.57
diff -u -r1.57 zle_hist.c
--- Src/Zle/zle_hist.c 11 May 2008 18:37:35 -0000 1.57
+++ Src/Zle/zle_hist.c 18 Sep 2008 20:31:08 -0000
@@ -599,7 +599,7 @@
static char *lastinsert;
static int lasthist, lastpos, lastlen;
- int evhist, save;
+ int evhist;
/*
* If we have at least one argument, the first is the history
@@ -722,10 +722,9 @@
t = he->node.nam + he->words[2*n-1];
}
- save = *t;
- *t = '\0'; /* ignore trailing whitespace */
lasthist = evhist;
lastpos = zlemetacs;
+ /* ignore trailing whitespace */
lastlen = t - s;
lastinsert = zalloc(t - s);
memcpy(lastinsert, s, lastlen);
@@ -734,11 +733,10 @@
unmetafy_line();
- zs = stringaszleline(s, 0, &len, NULL, NULL);
+ zs = stringaszleline(dupstrpfx(s, t - s), 0, &len, NULL, NULL);
doinsert(zs, len);
free(zs);
zmult = n;
- *t = save;
return 0;
}
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author