From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: word[-1]= breaks on multibyte?
Date: Fri, 8 Oct 2010 23:20:30 +0200 [thread overview]
Message-ID: <AANLkTi=Uc-2ykr9p=Ee3RQ6t-D8f9j8Tiwe8qwP5RVgd@mail.gmail.com> (raw)
% 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
next reply other threads:[~2010-10-08 21:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 21:20 Mikael Magnusson [this message]
2010-10-10 17:20 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=Uc-2ykr9p=Ee3RQ6t-D8f9j8Tiwe8qwP5RVgd@mail.gmail.com' \
--to=mikachu@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).