Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: support \u and \U in echo/print/$''
- X-seq: zsh-workers 18348
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: support \u and \U in echo/print/$''
- Date: Thu, 13 Mar 2003 10:47:10 +0100
- In-reply-to: <31418.1047461920@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <31418.1047461920@xxxxxxxxxxxxxxxxxxxx>
I wrote:
> '\unnnn' instead of one or other of the error messages. It should probably
> be consistent with \xx - currently \xZZ prints `ZZ'. I'd have thought
> `\xZZ' would be better. sh, ksh, bash and coreutils vary on this. Any
> thoughts?
Apparently, \xZZ prints a null followed by `ZZ'. So it allows less than
two digits. This is nice and easy to implement so the patch below, to
go on top of the previous makes \u consistent with \x.
The other two errors - where it is unable to convert the character are
still there as messages.
> Also, should this be disabled in sh emulation? Is it okay to just do
It seems not - SUSv3 apparently leaves other sequences after a backslash
as "unspecified".
Oliver
--- utils.c 2003-03-12 20:09:08.000000000 +0100
+++ utils.c 2003-03-13 00:04:56.000000000 +0100
@@ -3402,14 +3402,8 @@
(*s >= 'A' && *s <= 'F'))
wval = wval * 16 + (*s & 0x1f) + 9;
else {
- zerr("expected hexadecimal digit", NULL, 0);
- if (fromwhere == 4) {
- for (u = t; (*u++ = *++s););
- return t;
- }
- *t = '\0';
- *len = t - buf;
- return buf;
+ s--;
+ break;
}
}
if (fromwhere == 6) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author