zsh-workers
 help / color / mirror / code / Atom feed
* word[-1]= breaks on multibyte?
@ 2010-10-08 21:20 Mikael Magnusson
  2010-10-10 17:20 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2010-10-08 21:20 UTC (permalink / raw)
  To: zsh workers

% word=abcま
% echo $word
abcま
% echo $word[-1]
ま

so far so good, but
% word[-1]=
% echo $word
abc¾
% word=abcま
% word[-1]=a
% echo $word
abca¾
% word=abcま
% word[-2]=
% echo $word
abま

It seems like it finds the correct index, but the actual assignment
goes wrong. Only for negative indices though. Which is weird, I would
have thought the actual assignment was the same once it found the
spot.
% word=abなま
% word[-2]=c
% echo $word
abcªま
% word=abなま
% word[-1]=c
% echo $word
abなc¾
% word=abなま
% word[3]=c
% echo $word
abcま
% word=abなま
% word[4]=d
% echo $word
abなd


-- 
Mikael Magnusson


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

end of thread, other threads:[~2010-10-10 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-08 21:20 word[-1]= breaks on multibyte? Mikael Magnusson
2010-10-10 17:20 ` Peter Stephenson

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