From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27466 invoked from network); 26 Jun 2009 20:40:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 26 Jun 2009 20:40:57 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 40428 invoked from network); 26 Jun 2009 20:40:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jun 2009 20:40:44 -0000 Received: (qmail 20503 invoked by alias); 26 Jun 2009 20:40:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27057 Received: (qmail 20483 invoked from network); 26 Jun 2009 20:40:31 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Jun 2009 20:40:31 -0000 Received: from QMTA10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by bifrost.dotsrc.org (Postfix) with ESMTP id 4F51C8027106 for ; Fri, 26 Jun 2009 22:40:26 +0200 (CEST) Received: from OMTA07.westchester.pa.mail.comcast.net ([76.96.62.59]) by QMTA10.westchester.pa.mail.comcast.net with comcast id 8bn01c0071GhbT85AkgSl4; Fri, 26 Jun 2009 20:40:26 +0000 Received: from smtp.klanderman.net ([98.217.254.247]) by OMTA07.westchester.pa.mail.comcast.net with comcast id 8kgS1c00u5M2Np63TkgSav; Fri, 26 Jun 2009 20:40:26 +0000 Received: from lwm.klanderman.net (unknown [192.168.100.50]) by smtp.klanderman.net (Postfix) with ESMTP id 6BBC7B3014A; Fri, 26 Jun 2009 16:40:25 -0400 (EDT) Received: by lwm.klanderman.net (Postfix, from userid 500) id 4E9799FC61E; Fri, 26 Jun 2009 16:40:25 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19013.12857.274684.466725@gargle.gargle.HOWL> Date: Fri, 26 Jun 2009 16:40:25 -0400 From: Greg Klanderman To: Zsh list Subject: bug in ztrftime(): '%e' and '%f' specifiers swapped Reply-To: gak@klanderman.net X-Mailer: VM 7.17 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid X-Virus-Scanned: ClamAV 0.94.2/9510/Fri Jun 26 17:46:23 2009 on bifrost X-Virus-Status: Clean Hi Peter, I just tracked down a bug in 'cvs' completion, in particular the logic in _cvs_modified_entries, and found the problem is due to your changes in Src/utils.c, revision 1.210: | revision 1.210 | date: 2009/03/02 10:12:17; author: pws; state: Exp; lines: +56 -15 | 26614 + 26615: history -t plus ztrftime "-" format modifier You have inadvertently swapped the meanings of the '%e' and '%f' format specifiers. This patch should do the trick: Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.225 diff -u -r1.225 utils.c --- Src/utils.c 5 Jun 2009 11:15:53 -0000 1.225 +++ Src/utils.c 26 Jun 2009 20:18:41 -0000 @@ -2489,10 +2489,10 @@ *buf++ = '0' + tm->tm_mday / 10; *buf++ = '0' + tm->tm_mday % 10; break; - case 'e': + case 'f': strip = 1; /* FALLTHROUGH */ - case 'f': + case 'e': if (tm->tm_mday > 9) *buf++ = '0' + tm->tm_mday / 10; else if (!strip) However, I find this equivalent patch to be more readable: Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.225 diff -u -r1.225 utils.c --- Src/utils.c 5 Jun 2009 11:15:53 -0000 1.225 +++ Src/utils.c 26 Jun 2009 20:32:52 -0000 @@ -2490,9 +2490,8 @@ *buf++ = '0' + tm->tm_mday % 10; break; case 'e': - strip = 1; - /* FALLTHROUGH */ case 'f': + strip = strip || (fmt[-1] == 'f'); if (tm->tm_mday > 9) *buf++ = '0' + tm->tm_mday / 10; else if (!strip) @@ -2500,10 +2499,9 @@ *buf++ = '0' + tm->tm_mday % 10; break; case 'K': - strip = 1; - /* FALLTHROUGH */ case 'H': case 'k': + strip = strip || (fmt[-1] == 'K'); if (tm->tm_hour > 9) *buf++ = '0' + tm->tm_hour / 10; else if (!strip) { @@ -2515,9 +2513,8 @@ *buf++ = '0' + tm->tm_hour % 10; break; case 'L': - strip = 1; - /* FALLTHROUGH */ case 'l': + strip = strip || (fmt[-1] == 'L'); hr12 = tm->tm_hour % 12; if (hr12 == 0) hr12 = 12; Note: I didn't test either of those as I will not be able to build until I update my autoconf. Btw, are the zsh extension format specifiers documented? thanks, greg