From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout.scc.kit.edu (mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s7S0iX2c021612 for ; Wed, 27 Aug 2014 20:44:34 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1XMnpF-0004qR-Mq; Thu, 28 Aug 2014 02:44:29 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1XMnpF-0005aM-Kc; Thu, 28 Aug 2014 02:44:29 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1XMnpF-0000Jy-HN; Thu, 28 Aug 2014 02:44:29 +0200 Received: from schwarze by usta.de with local (Exim 4.77) (envelope-from ) id 1XMnoV-0002Tq-2D; Thu, 28 Aug 2014 02:43:43 +0200 Date: Thu, 28 Aug 2014 02:43:42 +0200 From: Ingo Schwarze To: =?iso-8859-1?Q?L=C9VAI_D=E1niel?= Cc: discuss@mdocml.bsd.lv Subject: Re: "cannot parse date" for a seemingly valid .Dd parameter Message-ID: <20140828004342.GF912@iris.usta.de> References: <20140827145844.GI29425@serenity.local> <53FDF43F.3060001@bsd.lv> <20140827151513.GJ29425@serenity.local> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140827151513.GJ29425@serenity.local> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Daniel, LÉVAI Dániel wrote on Wed, Aug 27, 2014 at 05:15:13PM +0200: > On sze, aug 27, 2014 at 17:07:43 +0200, Kristaps Dzonsons wrote: >> Is your locale set? This format works fine in HEAD, >> both on OpenBSD and Linux (Debian testing). > Yes, that was my first suspicion: > $ locale > LANG=en_US.UTF-8 > LC_CTYPE=hu_HU.UTF-8 > LC_NUMERIC=hu_HU.UTF-8 > LC_TIME=hu_HU.UTF-8 > LC_COLLATE=hu_HU.UTF-8 > LC_MONETARY=hu_HU.UTF-8 > LC_MESSAGES=en_US.UTF-8 > LC_PAPER=hu_HU.UTF-8 > LC_NAME=hu_HU.UTF-8 > LC_ADDRESS=hu_HU.UTF-8 > LC_TELEPHONE=hu_HU.UTF-8 > LC_MEASUREMENT=hu_HU.UTF-8 > LC_IDENTIFICATION=hu_HU.UTF-8 > LC_ALL= After some code reading and some experimentation, i'm still quite unsure where the problem might lie, i fail to reproduce but need additional information. Please apply the debugging patch appended below (not intended for commit) to anoncvs HEAD, and run: $ ./configure $ make Then please show me the output of the following sequence of commands: $ locale $ ./mandoc -Wall test.1 > /dev/null $ ./mandoc -Wall -Tlocale test.1 > /dev/null with a suitable file test.1 exhibiting the problem. Please also show me the config.h generated from ./configure. > Where can I get hold of the portable version's source repo? $ cvs -d anoncvs@mdocml.bsd.lv:/cvs mdocml Thanks, Ingo diff --git a/main.c b/main.c index e0380e9..9102143 100644 --- a/main.c +++ b/main.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,9 @@ main(int argc, char *argv[]) int options; int c; + fprintf(stderr, "main: LC_TIME = %s\n", + setlocale(LC_TIME, NULL)); + progname = strrchr(argv[0], '/'); if (progname == NULL) progname = argv[0]; diff --git a/mandoc.c b/mandoc.c index be3e264..090f948 100644 --- a/mandoc.c +++ b/mandoc.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -455,8 +456,11 @@ a2time(time_t *t, const char *fmt, const char *p) memset(&tm, 0, sizeof(struct tm)); + fprintf(stderr, "a2time: LC_TIME = %s\n", + setlocale(LC_TIME, NULL)); pp = NULL; #if HAVE_STRPTIME + fprintf(stderr, "a2time: calling strptime()\n"); pp = strptime(p, fmt, &tm); #endif if (NULL != pp && '\0' == *pp) { diff --git a/term_ascii.c b/term_ascii.c index ab62902..e1cf67c 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -81,9 +81,13 @@ ascii_init(enum termenc enc, char *outopts) #if HAVE_WCHAR if (TERMENC_ASCII != enc) { + fprintf(stderr, "ascii_init: LC_TIME = %s\n", + setlocale(LC_TIME, NULL)); v = TERMENC_LOCALE == enc ? setlocale(LC_ALL, "") : setlocale(LC_CTYPE, "en_US.UTF-8"); + fprintf(stderr, "ascii_init: LC_TIME = %s\n", + setlocale(LC_TIME, NULL)); if (NULL != v && MB_CUR_MAX > 1) { p->enc = enc; p->advance = locale_advance; -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv