1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-12-09 18:51:46 +01:00

25690: fix insert-last-word on multibyte characters with Meta

This commit is contained in:
Peter Stephenson 2008-09-18 20:35:37 +00:00
parent a84220930c
commit 1775a6ba81
2 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2008-09-18 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 25690: Src/Zle/zle_hist.c: fix insertlastword not to
screw up characters in the history that needed metafication.
2008-09-18 Peter Stephenson <pws@csr.com>
* 25684: Src/prompt.c: respect trap line number rules in

View file

@ -599,7 +599,7 @@ insertlastword(char **args)
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 @@ insertlastword(char **args)
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 @@ insertlastword(char **args)
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;
}