From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Bug in format-time-string in emacs 21.1? Date: 13 Mar 2002 22:13:33 +0000 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200203131059.g2DAx1I05506@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016057937 9063 127.0.0.1 (13 Mar 2002 22:18:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2002 22:18:57 +0000 (UTC) Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16lH5F-0002M5-00 for ; Wed, 13 Mar 2002 23:18:57 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16lH82-0001xy-00 for ; Wed, 13 Mar 2002 23:21:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16lH4j-00067l-00; Wed, 13 Mar 2002 17:18:25 -0500 Original-Received: from rhenium.btinternet.com ([194.73.73.93]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16lH3s-00065M-00 for ; Wed, 13 Mar 2002 17:17:32 -0500 Original-Received: from host62-7-39-3.in-addr.btopenworld.com ([62.7.39.3] helo=nyaumo.btinternet.com) by rhenium.btinternet.com with esmtp (Exim 3.22 #8) id 16lH3q-0002a8-00 for emacs-devel@gnu.org; Wed, 13 Mar 2002 22:17:31 +0000 Original-Received: from nyaumo.btinternet.com (localhost [127.0.0.1]) by nyaumo.btinternet.com (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id WAA00476 for ; Wed, 13 Mar 2002 22:13:34 GMT Original-To: emacs-devel@gnu.org In-Reply-To: <200203131059.g2DAx1I05506@wijiji.santafe.edu> Original-Lines: 36 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:1919 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1919 Richard Stallman writes: > Alternatively, we could introduce more conditional blocks to > strftime.c to do something sensible with the POSIX.2 extensions on > platforms that only support POSIX.1 formats. I think most of them > could be handled without too much effort. > > If someone wants to do this work, it would clearly give a better > result than documenting flaws. The following patch makes %h, %EX and %OX do sensible things on Windows. Is it worth making configure detect when these fail on other systems (ie does anyone know of other systems where these might not work)? --- strftime.c.~1.25.~ Mon Dec 31 18:26:41 2001 +++ strftime.c Wed Mar 13 22:01:14 2002 @@ -834,6 +834,13 @@ size_t strftime (); # endif +#ifdef STRFTIME_NO_POSIX2 + /* Some system libraries do not support the POSIX.2 extensions. + In those cases, convert %h to %b, and strip modifiers. */ + modifier = 0; + if (format_char == 'h') + format_char = 'b'; +#endif *u++ = '%'; if (modifier != 0) *u++ = modifier; -- Jason Rumney _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel