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 11:58:57 -0800 Organization: UCLA Computer Science Department Message-ID: <50C39C01.1020303@cs.ucla.edu> References: <50BD0C72.7070601@cs.ucla.edu> <50C2BBD9.8060401@cs.ucla.edu> <83zk1olqh8.fsf@gnu.org> <50C376F9.3000603@cs.ucla.edu> <83vccccs5l.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 1354996785 31800 80.91.229.3 (8 Dec 2012 19:59:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2012 19:59:45 +0000 (UTC) Cc: 13070@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 20:59:57 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 1ThQZ0-0004VY-2E for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2012 20:59:54 +0100 Original-Received: from localhost ([::1]:57547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThQYn-0005kO-TV for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2012 14:59:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThQYl-0005k8-5M for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 14:59:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThQYk-0003gX-3A for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 14:59:39 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThQYk-0003gT-0A for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 14:59:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1ThQZ8-0000uR-Tu for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2012 15:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Dec 2012 20:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 13070-submit@debbugs.gnu.org id=B13070.13549967623421 (code B ref 13070); Sat, 08 Dec 2012 20:00:02 +0000 Original-Received: (at 13070) by debbugs.gnu.org; 8 Dec 2012 19:59:22 +0000 Original-Received: from localhost ([127.0.0.1]:33204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThQYU-0000t7-2e for submit@debbugs.gnu.org; Sat, 08 Dec 2012 14:59:22 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:52479) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThQYR-0000sy-1I for 13070@debbugs.gnu.org; Sat, 08 Dec 2012 14:59:20 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A46E039E8106; Sat, 8 Dec 2012 11:58:52 -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 0kecq4dII-IG; Sat, 8 Dec 2012 11:58: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 36AD739E8008; Sat, 8 Dec 2012 11:58:52 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <83vccccs5l.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:68203 Archived-At: On 12/08/2012 10:31 AM, Eli Zaretskii wrote: > What about NULL pointers? putenv typically dumps core when passed NULL, so checking errno afterwards wouldn't help. > Or strings without a '='? Typically that's valid; it's equivalent to unsetenv. So typically, checking errno afterwards wouldn't help. > it's silly to rely on unspecified behavior Emacs doesn't rely on unspecified behavior, since it never passes NULL or '='-less strings to xputenv. Emacs has many, many places where we could put easserts, but we don't bother because the disadvantages of code clutter outweigh any advantages of catching bugs, and this appears to be one of those places.