zsh-workers
 help / color / mirror / code / Atom feed
* weird history bug (involves unicode characters)
@ 2008-09-18 12:15 Mikael Magnusson
  2008-09-18 20:33 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2008-09-18 12:15 UTC (permalink / raw)
  To: zsh-workers

zsh -f<enter>
: ト<enter>
<alt-.>
#this brings back the ト
<ctrl-c>
<uparrow>

only the colon appears, and alt-. also stops working completely
if you had more commands earlier in history you can't access them
via alt-., though uparrow still works, it just leaves out the ト.

And the character I have been using is 30c8, though it happens for others
as well. It doesn't happen for コ (30b3) and セ (30bb), and it does additionally
happen to ラ (30e9) and マ (30de). The only thing I can see in the bit pattern
of those numbers is that the seventh (from the right) bit is set for the three
failing chars i found so far, and not for the other two.

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: weird history bug (involves unicode characters)
  2008-09-18 12:15 weird history bug (involves unicode characters) Mikael Magnusson
@ 2008-09-18 20:33 ` Peter Stephenson
  2008-09-18 21:27   ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2008-09-18 20:33 UTC (permalink / raw)
  To: zsh-workers

On Thu, 18 Sep 2008 14:15:12 +0200
"Mikael Magnusson" <mikachu@gmail.com> 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@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: weird history bug (involves unicode characters)
  2008-09-18 20:33 ` Peter Stephenson
@ 2008-09-18 21:27   ` Mikael Magnusson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2008-09-18 21:27 UTC (permalink / raw)
  To: zsh-workers

2008/9/18 Peter Stephenson <p.w.stephenson@ntlworld.com>:
> On Thu, 18 Sep 2008 14:15:12 +0200
> "Mikael Magnusson" <mikachu@gmail.com> 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.

Thanks, this fixes the problem for me. I've seen the problem intermittently
for a while, but it wasn't until today that I figured out that
insert-last-word was the problem.

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-18 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-18 12:15 weird history bug (involves unicode characters) Mikael Magnusson
2008-09-18 20:33 ` Peter Stephenson
2008-09-18 21:27   ` Mikael Magnusson

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).