zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: support \u and \U in echo/print/$''
Date: Thu, 13 Mar 2003 10:47:10 +0100	[thread overview]
Message-ID: <3803.1047548830@finches.logica.co.uk> (raw)
In-Reply-To: <31418.1047461920@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) {


      reply	other threads:[~2003-03-13  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-12  9:38 Oliver Kiddle
2003-03-13  9:47 ` Oliver Kiddle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3803.1047548830@finches.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).