From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#23600: 25.1.50; encode-time returns wrong result Date: Sat, 4 Jun 2016 10:15:04 -0700 Organization: UCLA Computer Science Department Message-ID: <57530C98.3030508@cs.ucla.edu> References: <574E9AA6.1070606@cs.ucla.edu> <83h9d9uf3d.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1465060604 3721 80.91.229.3 (4 Jun 2016 17:16:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jun 2016 17:16:44 +0000 (UTC) Cc: kzhr@d1.dion.ne.jp, 23600@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 04 19:16:29 2016 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 1b9FBJ-0005nN-1Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jun 2016 19:16:17 +0200 Original-Received: from localhost ([::1]:33516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9FBI-0007O8-E4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Jun 2016 13:16:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9FBA-0007MV-MF for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2016 13:16:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9FB4-000612-LA for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2016 13:16:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9FB4-00060x-Hg for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2016 13:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b9FB4-0003KU-Be for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2016 13:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jun 2016 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23600 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 23600-submit@debbugs.gnu.org id=B23600.146506051412741 (code B ref 23600); Sat, 04 Jun 2016 17:16:02 +0000 Original-Received: (at 23600) by debbugs.gnu.org; 4 Jun 2016 17:15:14 +0000 Original-Received: from localhost ([127.0.0.1]:54593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9FAI-0003JR-3c for submit@debbugs.gnu.org; Sat, 04 Jun 2016 13:15:14 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9FAF-0003JB-Pe for 23600@debbugs.gnu.org; Sat, 04 Jun 2016 13:15:12 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 04ED6161460; Sat, 4 Jun 2016 10:15:06 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hbVRRaVPu9_E; Sat, 4 Jun 2016 10:15:05 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4076E16147A; Sat, 4 Jun 2016 10:15:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Wwtt5oC34nA6; Sat, 4 Jun 2016 10:15:05 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1E6D2161460; Sat, 4 Jun 2016 10:15:05 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <83h9d9uf3d.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:119069 Archived-At: Eli Zaretskii wrote: > Do callers of putenv expect the argument to be destroyed? Yes and no. POSIX says that the environment can be modified in-place, so = a=20 caller of putenv (S) should be prepared for *S to be modified (which is w= hat I=20 assume you mean by "destroyed") because the string will be put into the=20 environment. Also, POSIX allows putenv to modify *S, as S is of type char= * and=20 there is no prohibition in the standard against putenv modifying the poin= ted-to=20 storage. That being said, I don't know of any POSIXish implementation of = putenv=20 (S) that modifies *S and I doubt whether any mainstream implementation wo= uld do=20 that. Although the code you mention is stretching things a bit, it's not stretc= hing=20 them beyond recognition: the intent of putenv ("TZ=3D-9") is not rea= lly "set=20 the 'TZ' value to the byte-string '-9' in the environment array", it= 's more=20 "set the time zone to 9 hours ahead of UTC and with abbreviation 'JST'", = and on=20 MS-Windows the code implements this intent more faithfully than doing not= hing would.