From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21020: 24.4; `display-time-world' tampers with TZ Date: Tue, 28 Jul 2015 13:37:38 +0300 Message-ID: <83lhe0y3d9.fsf@gnu.org> References: <55B487B4.7060709@cs.ucla.edu> <83vbd7yny9.fsf@gnu.org> <55B51362.2010301@cs.ucla.edu> <83lhe2zuu9.fsf@gnu.org> <55B51F1A.2000100@cs.ucla.edu> <83io96zsnj.fsf@gnu.org> <55B5399C.8040202@cs.ucla.edu> <83fv49zsuq.fsf@gnu.org> <83zj2hy0e0.fsf@gnu.org> <55B6D651.4070601@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1438079903 27618 80.91.229.3 (28 Jul 2015 10:38:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2015 10:38:23 +0000 (UTC) Cc: 21020@debbugs.gnu.org, wgg2@member.fsf.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 28 12:38:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZK2Gw-0002Mz-MI for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jul 2015 12:38:10 +0200 Original-Received: from localhost ([::1]:57998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK2Gw-0006qC-1L for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Jul 2015 06:38:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK2Gs-0006pf-Qu for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2015 06:38:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZK2Go-0003Bd-QA for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2015 06:38:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK2Go-0003BX-Mz for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2015 06:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZK2Go-0007mE-7f for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2015 06:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jul 2015 10:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 21020-submit@debbugs.gnu.org id=B21020.143807987429881 (code B ref 21020); Tue, 28 Jul 2015 10:38:02 +0000 Original-Received: (at 21020) by debbugs.gnu.org; 28 Jul 2015 10:37:54 +0000 Original-Received: from localhost ([127.0.0.1]:60711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZK2Gf-0007ls-Ui for submit@debbugs.gnu.org; Tue, 28 Jul 2015 06:37:54 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:44326) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZK2Gc-0007lh-1A for 21020@debbugs.gnu.org; Tue, 28 Jul 2015 06:37:51 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NS700K001FUBC00@a-mtaout20.012.net.il> for 21020@debbugs.gnu.org; Tue, 28 Jul 2015 13:37:48 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NS700KTA1J05I30@a-mtaout20.012.net.il>; Tue, 28 Jul 2015 13:37:48 +0300 (IDT) In-reply-to: <55B6D651.4070601@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:105191 Archived-At: > Date: Mon, 27 Jul 2015 18:09:37 -0700 > From: Paul Eggert > CC: 21020@debbugs.gnu.org, wgg2@member.fsf.org > > Eli Zaretskii wrote: > > I'm not even sure I > > understand completely why this trick is needed (can you explain?). > > On many platforms, calling 'tzset' (either directly, or indirectly via localtime > etc.) invalidates tzname[0] and tzname[1]. For example: > > time_t t = 0; > char *p = tzname[0]; > localtime (&t); > puts (p ? p : "(null)"); > > Here 'puts' has undefined behavior if tzname[0] has been updated and its old > value (equal to P) is no longer a valid pointer. > > lib/time_rz.c attempted to work around this problem by replacing tzname[0] and > tzname[1] with pointers to more-stable copies. Apparently this doesn't work > under MinGW. I see, thanks for explaining. > > can we please do this in some less intrusive way, e.g., by > > copying the TZ names to our private storage? > > OK, I did that in master commit 2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237. Thanks, this solves the problem.