From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18566 invoked from network); 9 Sep 2006 20:52:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Sep 2006 20:52:50 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 52468 invoked from network); 9 Sep 2006 20:52:42 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Sep 2006 20:52:42 -0000 Received: (qmail 9764 invoked by alias); 9 Sep 2006 20:52:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22682 Received: (qmail 9754 invoked from network); 9 Sep 2006 20:52:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Sep 2006 20:52:39 -0000 Received: (qmail 52221 invoked from network); 9 Sep 2006 20:52:39 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 9 Sep 2006 20:52:37 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id C003370055; Sat, 9 Sep 2006 16:52:34 -0400 (EDT) Date: Sat, 9 Sep 2006 16:52:34 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Hrvoje Niksic , 386730-forwarded@bugs.debian.org Subject: Re: Bug#386730: zsh: printf doesn't handle single-digit and two-digit octal escapes Message-ID: <20060909205234.GA5303@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk, Hrvoje Niksic , 386730-forwarded@bugs.debian.org References: <20060909190321.4014.89342.reportbug@mulj> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060909190321.4014.89342.reportbug@mulj> User-Agent: Mutt/1.5.13 (2006-08-11) Will changing getkeystring() break anything? > zsh's builtin printf fails to interpret two-digit octal escape, such as '\1' > or '\33'. For example: > > zsh% printf '\33abc' | hd > 00000000 5c 33 33 61 62 63 |\33abc| > 00000006 > > On the other hand, the printf from textutils handles them: > > $ /usr/bin/printf '\33abc' | hd > 00000000 1b 61 62 63 |.abc| > 00000004 > > The zshbuiltins man page promises "formatting rules are the same as used in > C", and C explicitly supports single-digit and double-digit octal escapes in > string and character literals -- see section "6.4.4.4 Character constants" > of the C99 standard. > > Furthermore, POSIX explicitly states that \d and \dd are supported by > printf(1) -- see http://tinyurl.com/gkdfr/, extended description, item 3. > The Solaris printf(1), the bash printf builtin, and the FreeBSD printf(1) > all support them.