From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4125 invoked from network); 13 Mar 2003 09:44:00 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2003 09:44:00 -0000 Received: (qmail 7458 invoked by alias); 13 Mar 2003 09:43:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18348 Received: (qmail 7448 invoked from network); 13 Mar 2003 09:43:43 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Mar 2003 09:43:43 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Mar 2003 9:43:42 -0000 Received: (qmail 898 invoked from network); 13 Mar 2003 09:43:22 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-6.tower-1.messagelabs.com with SMTP; 13 Mar 2003 09:43:22 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id JAA14249 for ; Thu, 13 Mar 2003 09:43:22 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h2D9lA803805 for ; Thu, 13 Mar 2003 10:47:11 +0100 X-VirusChecked: Checked In-reply-to: <31418.1047461920@finches.logica.co.uk> From: Oliver Kiddle To: zsh-workers@sunsite.dk References: <31418.1047461920@finches.logica.co.uk> Subject: Re: PATCH: support \u and \U in echo/print/$'' Date: Thu, 13 Mar 2003 10:47:10 +0100 Message-ID: <3803.1047548830@finches.logica.co.uk> 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) {