Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
word[-1]= breaks on multibyte?
- X-seq: zsh-workers 28333
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: word[-1]= breaks on multibyte?
- Date: Fri, 8 Oct 2010 23:20:30 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=6flFTBqhjJbTlra6OYVyPw787ikFOG3uLUEMdVIKXgw=; b=f+mv0C1L5jmyrdKkbgHuSOxYfsCz+9rqiWPixgI6elvCnXNAB7XqRcYt5p/bvZU6wr 2LiIPF2c8S+3UcC0h0/aM93jgu/PHf4HFtZ3pXH1UjpP5XjHPAoWf+mSA2DqYgt2OyO3 ltVhpV3uqOIm6TI9vOXkJx6dNGAkcj8PMlf+M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=eLFAzYbbn2C0d1qNXhA2xmmqRHXuna4MkIXTUDtHKTC0+HYW0KWQ+zlPKvQhp0rgqW bX3948d9bEKmsaVp/bsbse3awvYQfwZpZvZL8b8E3c8w8zLbWQIDNOTO0V7DOk/n4y8y BjWqu4FLKGbYLv6F/XgbM/kMwuQSWeUMOWEko=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
% 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author