From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16240 invoked from network); 24 Jul 2005 02:07:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jul 2005 02:07:48 -0000 Received: (qmail 1669 invoked from network); 24 Jul 2005 02:07:42 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jul 2005 02:07:42 -0000 Received: (qmail 12554 invoked by alias); 24 Jul 2005 02:07:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21509 Received: (qmail 12544 invoked from network); 24 Jul 2005 02:07:23 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jul 2005 02:07:23 -0000 Received: (qmail 1330 invoked from network); 24 Jul 2005 02:07:21 -0000 Received: from pop.gmx.de (HELO mail.gmx.net) (213.165.64.20) by a.mx.sunsite.dk with SMTP; 24 Jul 2005 02:07:16 -0000 Received: (qmail invoked by alias); 24 Jul 2005 02:07:15 -0000 Received: from Bc906.b.pppool.de (EHLO pcdahl4201) [213.7.201.6] by mail.gmx.net (mp006) with SMTP; 24 Jul 2005 04:07:15 +0200 X-Authenticated: #21620914 Message-ID: <003c01c58ff5$870469a0$13e6fea9@pcdahl4201> From: "Thorsten Dahlheimer" To: Subject: PATCH: Expansion of \c escape sequences Date: Sun, 24 Jul 2005 04:15:12 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0039_01C59006.499915A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Y-GMX-Trusted: 0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 This is a multi-part message in MIME format. ------=_NextPart_000_0039_01C59006.499915A0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Hi, I've noticed that in contexts where escape sequences are expanded and \c's should not be recognized (i.e., not in arguments to the various printing commands), then a \c is actually treated synonymous to \U. The attached patch contains a fix. While inspecting the code I came across another glitch: If a \c occurs in the separator string of a $arr[(pws:...:)...] subscript, it is not treated like an unrecognized sequence (i.e., replaced by a "c"), but removed completely. (Note that ${(p...)...} gets this right.) The attached patch also fixes that. Finally, I've discovered that \c in an argument to a printing command only suppresses the final newline, but according POSIX it should suppress all output after the \c, and that's what ksh, bash, and echo/printf from GNU coreutils do. So is the current behaviour really desired, or should I send a patch to change it? Best regards Thorsten Dahlheimer ------=_NextPart_000_0039_01C59006.499915A0 Content-Type: application/octet-stream; name="bsc.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bsc.patch" Index: Src/utils.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/utils.c,v=0A= retrieving revision 1.78=0A= diff -u -r1.78 utils.c=0A= --- Src/utils.c 31 Mar 2005 09:54:59 -0000 1.78=0A= +++ Src/utils.c 24 Jul 2005 00:38:16 -0000=0A= @@ -3611,6 +3611,7 @@=0A= *misc =3D 1;=0A= break;=0A= }=0A= + goto def;=0A= case 'u':=0A= case 'U':=0A= wval =3D 0;=0A= Index: Src/params.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/params.c,v=0A= retrieving revision 1.98=0A= diff -u -r1.98 params.c=0A= --- Src/params.c 8 Apr 2005 16:42:58 -0000 1.98=0A= +++ Src/params.c 24 Jul 2005 00:37:52 -0000=0A= @@ -1002,7 +1002,7 @@=0A= goto flagerr;=0A= sav =3D *t;=0A= *t =3D '\0';=0A= - sep =3D escapes ? getkeystring(s + 1, &waste, 1, &waste) :=0A= + sep =3D escapes ? getkeystring(s + 1, &waste, 3, NULL) :=0A= dupstring(s + 1);=0A= *t =3D sav;=0A= s =3D t;=0A= ------=_NextPart_000_0039_01C59006.499915A0--