Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
EILSEQ in the C locale? (Was: $(<nofile) doesn't set $? to non-zero)
- X-seq: zsh-workers 42466
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: EILSEQ in the C locale? (Was: $(<nofile) doesn't set $? to non-zero)
- Date: Thu, 15 Mar 2018 07:25:50 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NsSUtW6/4XPpt3BESYKJCU0xBcRPbenntsrlmvh1klU=; b=Ud2vqWFwC28VONz5KkYK50P4dr2eSrpGEwMTJla0Ev4i+tt0InN/8halviNHzBiKft caUlk6G70jr4VpuOlaTU0ZGceA+hJbYyzYEEtjPgASO0P8xcHjUvgV/6PINaiIwe5PpC 8SX2Jla4WjYWwfinBIIbnjkoNf0T+FkpD/rWXyB1ePPA6lWwsx8ZtEqIIE0hyXxQN1a/ D1cWpHKwvgKlaB8lnWLYTwcFEq0u5d35AUWmppfxcxBVRhbwWyI9ky4RZQjJyf0elxYc ks5hVeFJdm5YKKlqvqM8zRXkGDIQKkhU5LwbatsMm9i4J9hCBDbOwJc0g315Lqj7o1sm Uk4g==
- In-reply-to: <20180315071204.GA10057@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20180314103335epcas4p30222f0df02adda27cbddbe62075ff9ad@epcas4p3.samsung.com> <20180314103254.GA10404@chaz.gmail.com> <20180314105442.28c5554a@camnpupstephen> <20180314144248.GC10404@chaz.gmail.com> <20180314145004.6e4b971b@camnpupstephen> <20180315071204.GA10057@chaz.gmail.com>
2018-03-15 07:12:04 +0000, Stephane Chazelas:
[...]
> $ sudo ./Src/zsh -c 'ERRNO=0; v=$(</dev/mem); echo $? $ERRNO $#v'
> zsh:1: error when reading /dev/mem: operation not permitted
> 1 1 1046296
[...]
BTW, when swapping $#v and $ERRNO above, I noticed that I was
seeing some EILSEQ errors even in the C locale because of
"malformed characters".
I wouldn't expect to get those in a C locale or other locales
with single-byte charsets.
$ a=$'\x80' LC_ALL=C zsh -c 'ERRNO=0; echo $#a $ERRNO'
1 84
$ syserror 84
Invalid or incomplete multibyte or wide character
Maybe some optimisation could be done and things like mbstowc()
avoided when MB_CUR_MAX is 1 or something like that?
(here, I beleive my mbstowc() returns EILSEQ in the C locale for
byte values above 0x7f).
(maybe not worth the effort).
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author