Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Quoting problem and crashes with ${(#)var}
- X-seq: zsh-workers 23189
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Quoting problem and crashes with ${(#)var}
- Date: Mon, 26 Feb 2007 10:34:01 +0000
- In-reply-to: <070225151543.ZM32724@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200702132111.l1DLB5rA003849@xxxxxxxxxxxxxxxxx> <070213234815.ZM5424@xxxxxxxxxxxxxxxxxxxxxx> <200702141016.l1EAGpKF016735@xxxxxxxxxxxxxx> <070214080347.ZM26428@xxxxxxxxxxxxxxxxxxxxxx> <20070214161951.e8219d6c.pws@xxxxxxx> <070225151543.ZM32724@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> I'm not certain the following is the right way to fix it; is something
> more wide-char-aware than strcpy/strlen needed?
>
> - return nicechar((int)c);
> + strcpy(buf, nicechar((int)c));
> + if (widthp)
> + *widthp = strlen(buf);
If printeightbit is set, then nicechar() may pass 8-bit characters,
which may be metafied, straight through, so ztrlen() is probably better.
printeightbit doesn't guaranteed to get character lengths right, but
counting metafied characters as 1 is more consistent.
I don't think we need to take account of wide characters here; we don't
have the information for that in this branch of the code.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author