Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: EILSEQ in the C locale? (Was: $(<nofile) doesn't set $? to non-zero)
- X-seq: zsh-workers 42480
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: EILSEQ in the C locale? (Was: $(<nofile) doesn't set $? to non-zero)
- Date: Sun, 18 Mar 2018 17:09:09 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=XC/fb5JkW9Ghd1u4RL9NPWDNnLkk+qX1mTjRiDOyjoU=; b=tEUZApvzI8I2nNbybxm+P+zJ4pJimgHk7bw7WtKyXUW59CQnTaHgF7ITLw9q0ZZqB/ 6mKHoqukPMRvgQrUYmWWam8bsoeX8u5aV0Yv6eCQDhbH4/X0oiW7NRBQygsAPBZLmwWk 4+o/gF1yNx0C0cJLw3xhbpmCwMKMMxONZaSIpx/0gMw5KbTYKykzehx4ckMHdezFXKTa ey8DdiNDb7pZzNMIx14umDuq2anSniivYUF7W8vXzMCb5EIjz1g1g9PDZHtwk6b+MLUT 6u3SDBROSf1RtW+hgpEHmdF3SNXjWodZsKHNRUPqbWBB4FYCb2jyF7JevI9dlTWkP5Tn PhMw==
- In-reply-to: <20180315072550.GB10057@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>
- 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> <20180315072550.GB10057@chaz.gmail.com>
On Mar 15, 7:25am, Stephane Chazelas wrote:
}
} Maybe some optimisation could be done and things like mbstowc()
} avoided when MB_CUR_MAX is 1 or something like that?
The following seems to work for this particular case ($#var) but there
are other places where we walk a wide char array with mbrtowc() so this
is not complete.
diff --git a/Src/utils.c b/Src/utils.c
index 3b589aa..ba78f29 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -5496,7 +5496,7 @@ mb_metastrlenend(char *ptr, int width, char *eptr)
wchar_t wc;
int num, num_in_char, complete;
- if (!isset(MULTIBYTE))
+ if (!isset(MULTIBYTE) || MB_CUR_MAX == 1)
return eptr ? (int)(eptr - ptr) : ztrlen(ptr);
laststart = ptr;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author