From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.bugs Subject: bug#19874: 25.0.50; encode-time not working as expected Date: Sat, 28 Feb 2015 15:10:47 +0100 Message-ID: <85lhjim8ig.fsf@iznogoud.viz> References: <54EE0959.5080901@cs.ucla.edu> <86sidta5ak.fsf@chateau.d.if> <54EED638.8070604@cs.ucla.edu> <85385s94c9.fsf@iznogoud.viz> <54EF5ECD.2030909@cs.ucla.edu> <85mw405whp.fsf@iznogoud.viz> <86a900sbix.fsf@chateau.d.if> <85ioeo5tgf.fsf@iznogoud.viz> <8661aos5ui.fsf@chateau.d.if> <85h9u8rrsb.fsf@iznogoud.viz> <864mq8ar1g.fsf@chateau.d.if> <54F010E7.3040900@cs.ucla.edu> <8561an5k8q.fsf@iznogoud.viz> <54F10399.8010207@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1425132742 22246 80.91.229.3 (28 Feb 2015 14:12:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Feb 2015 14:12:22 +0000 (UTC) Cc: 19874@debbugs.gnu.org, Ashish SHUKLA To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 28 15:12:12 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 1YRi7n-00066r-QE for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Feb 2015 15:12:11 +0100 Original-Received: from localhost ([::1]:41301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRi7n-0007To-1I for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Feb 2015 09:12:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRi7h-0007PB-Va for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 09:12:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRi7e-0001ah-Pi for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 09:12:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRi7e-0001ad-Ms for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 09:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YRi7e-0007An-4g for bug-gnu-emacs@gnu.org; Sat, 28 Feb 2015 09:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Jenkner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Feb 2015 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19874 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19874-submit@debbugs.gnu.org id=B19874.142513266927507 (code B ref 19874); Sat, 28 Feb 2015 14:12:02 +0000 Original-Received: (at 19874) by debbugs.gnu.org; 28 Feb 2015 14:11:09 +0000 Original-Received: from localhost ([127.0.0.1]:60450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRi6n-00079b-5P for submit@debbugs.gnu.org; Sat, 28 Feb 2015 09:11:09 -0500 Original-Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:65153) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRi6j-000791-Uy for 19874@debbugs.gnu.org; Sat, 28 Feb 2015 09:11:07 -0500 Original-Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150228141049.OHEL17514.b2bfep16-int.chello.at@edge12.upcmail.net> for <19874@debbugs.gnu.org>; Sat, 28 Feb 2015 15:10:49 +0100 Original-Received: from iznogoud.viz ([91.119.222.134]) by edge12.upcmail.net with edge id xqAo1p0062ubb8B0CqAozB; Sat, 28 Feb 2015 15:10:49 +0100 X-SourceIP: 91.119.222.134 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YRi6S-0000L6-4B; Sat, 28 Feb 2015 15:10:48 +0100 In-Reply-To: <54F10399.8010207@cs.ucla.edu> (Paul Eggert's message of "Fri, 27 Feb 2015 15:54:01 -0800") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) 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:99899 Archived-At: On Fri, Feb 27 2015, Paul Eggert wrote: > On 02/27/2015 09:33 AM, Wolfgang Jenkner wrote: >> IIUC, the standard explicitly permits the FreeBSD behaviour, so the >> program above does not seem to be conforming: >> >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html >> >> If the application switches to a complete new environment by >> assigning a new value to environ, this can be detected by >> getenv(), setenv(), unsetenv(), or putenv() and the >> implementation can at that point reinitialize based on the new >> environment. (This may include copying the environment strings >> into a new array and assigning environ to point to it.) > > No, because that part of the rationale is not talking about the buggy > FreeBSD behavior. Although the test program does assign a new value > to environ, that's not a problem because everything still works: > 'setenv' reinitializes based on the new environment, as it's allowed > to do. The problem doesn't occur until after the assignment "env1[0] > = 'x'", and this is a different matter. > > As the getenv rationale points out, "conforming applications are > required not to directly modify the pointers to which /environ/ > points", and it appears that's the restriction you're thinking about. No, I think about the parenthetical remark above: It states `copying the environment strings' and not `copying the pointers to the environment strings'. Normally, in documentation, copying a `string' refers to the object, i.e the region in memory it occupies, not to the pointer designating it. And the program modifies env1 after it may have copied to the new `environment'. Wolfgang