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#13070: Use putenv+unsetenv instead of modifying environ directly Date: Sat, 08 Dec 2012 09:20:57 -0800 Organization: UCLA Computer Science Department Message-ID: <50C376F9.3000603@cs.ucla.edu> References: <50BD0C72.7070601@cs.ucla.edu> <50C2BBD9.8060401@cs.ucla.edu> <83zk1olqh8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354987302 23435 80.91.229.3 (8 Dec 2012 17:21:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2012 17:21:42 +0000 (UTC) Cc: 13070-done@debbugs.gnu.org, fabrice.popineau@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 08 18:21:55 2012 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 1ThO67-0002qI-0c for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2012 18:21:55 +0100 Original-Received: from localhost ([::1]:56728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThO5u-0000id-Jl for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2012 12:21:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThO5q-0000hM-Of for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 12:21:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThO5p-0001PW-Om for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 12:21:38 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThO5p-0001PS-LQ for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 12:21:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1ThO6E-0005hP-Js for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 12:22:02 -0500 Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Dec 2012 17:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 13070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 13070@debbugs.gnu.org, eggert@cs.ucla.edu, eggert@cs.ucla.edu Original-Received: via spool by 13070-done@debbugs.gnu.org id=D13070.135498728221848 (code D ref 13070); Sat, 08 Dec 2012 17:22:02 +0000 Original-Received: (at 13070-done) by debbugs.gnu.org; 8 Dec 2012 17:21:22 +0000 Original-Received: from localhost ([127.0.0.1]:33094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThO5Z-0005gK-No for submit@debbugs.gnu.org; Sat, 08 Dec 2012 12:21:21 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:47721) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThO5W-0005gC-US for 13070-done@debbugs.gnu.org; Sat, 08 Dec 2012 12:21:20 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2695CA60002; Sat, 8 Dec 2012 09:20:53 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qWzfovDmM5FE; Sat, 8 Dec 2012 09:20:52 -0800 (PST) Original-Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6C630A60001; Sat, 8 Dec 2012 09:20:52 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <83zk1olqh8.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:68194 Archived-At: On 12/08/2012 03:42 AM, Eli Zaretskii wrote: > Shouldn't we refrain from signaling memory_full when errno is EINVAL? > I'd suggest an eassert in that case. memory_full will emit a > misleading diagnostic. errno cannot be EINVAL, at least not on a POSIXish host: all strings are allowed as arguments to putenv. If Microsoft platforms are different it would make sense to put in an eassert, in w32.c presumably. I did see a minor problem in the w32.c implementation of unsetenv: /* MS docs says an environment variable cannot be longer than 32K. */ if (name_len > 32767) { errno = ENOMEM; return -1; } unsetenv should return 0 in that case, not -1, since the variable cannot possibly be in the environment. This bug doesn't affect Emacs so it's not a pressing one. I committed the patch as trunk bzr 111158 and am marking this bug as fixed.