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#23779: 25.0.95; consing "SHELLVAR" onto process-environment doesn't remove it from subprocess env Date: Sun, 19 Jun 2016 04:27:32 +0200 Message-ID: <57660314.9050907@cs.ucla.edu> References: <837fdocmrl.fsf@gnu.org> <962d42ee-847c-507e-d457-2d6f9a38e955@yandex.ru> <83wplnc3t8.fsf@gnu.org> <83vb17c2z3.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070303010503000600090905" X-Trace: ger.gmane.org 1466303306 15620 80.91.229.3 (19 Jun 2016 02:28:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2016 02:28:26 +0000 (UTC) Cc: 23779@debbugs.gnu.org, npostavs@users.sourceforge.net To: Eli Zaretskii , Dmitry Gutov , Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 19 04:28:15 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 1bEST8-0005qO-Ru for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jun 2016 04:28:15 +0200 Original-Received: from localhost ([::1]:37165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEST7-000373-KD for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 22:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEST0-00035w-Mi for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 22:28:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bESSw-0007ES-Ef for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 22:28:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bESSw-0007EO-BY for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 22:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bESSv-0007Zi-Vx for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 22:28: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: Sun, 19 Jun 2016 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23779 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23779-submit@debbugs.gnu.org id=B23779.146630326529094 (code B ref 23779); Sun, 19 Jun 2016 02:28:01 +0000 Original-Received: (at 23779) by debbugs.gnu.org; 19 Jun 2016 02:27:45 +0000 Original-Received: from localhost ([127.0.0.1]:45523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bESSe-0007ZC-Sg for submit@debbugs.gnu.org; Sat, 18 Jun 2016 22:27:45 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bESSd-0007Yz-OJ for 23779@debbugs.gnu.org; Sat, 18 Jun 2016 22:27:44 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D8DDC1613EA; Sat, 18 Jun 2016 19:27:37 -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 W8InnmR-iExU; Sat, 18 Jun 2016 19:27:36 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CA6DD1613C6; Sat, 18 Jun 2016 19:27:36 -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 SwyxukDcubjr; Sat, 18 Jun 2016 19:27:36 -0700 (PDT) Original-Received: from [192.168.1.2] (host156-229-dynamic.37-79-r.retail.telecomitalia.it [79.37.229.156]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 71AD91613EA; Sat, 18 Jun 2016 19:27:35 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <83vb17c2z3.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:119762 Archived-At: This is a multi-part message in MIME format. --------------070303010503000600090905 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 06/17/2016 04:19 PM, Eli Zaretskii wrote: >> Looks like it does. Please push at your convenience. > I'd like the patch to be eyeballed by a few more people. Paul, > Andreas, do you see any problems with it? If not, I'd like to push it > to the emacs-25 branch The patch is correct. The code is tricky so I'm not surprised you wanted another pair of eyes. The attached patch is a very minor tweak of your patch that made it a bit easier for me to follow. I resisted the temptation of cleaning up the surrounding code to make it more readable. I like the idea of putting this into the emacs-25 branch. (Or your patch; doesn't really matter.) --------------070303010503000600090905 Content-Type: text/x-patch; name="0001-Consing-V-into-process-environment-should-remove-V.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Consing-V-into-process-environment-should-remove-V.patc"; filename*1="h" >From ed5dabd6bb61613649f619f6f210d070812895d7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Jun 2016 03:58:37 +0200 Subject: [PATCH] Consing "V" into process-environment should remove V Problem reported by Noam Postavsky (Bug#23779). * src/callproc.c (add_env): Consider new string "FOO=BAR" to match plain "FOO" in the old proto-environment. This is a slight tweak of the fix suggested by Eli Zaretskii in http://bugs.gnu.org/23779#14 --- src/callproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/callproc.c b/src/callproc.c index db602f5..38f3f92 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1099,7 +1099,7 @@ add_env (char **env, char **new_env, char *string) char *p = *ep, *q = string; while (ok) { - if (*q != *p) + if (*q != *p && *p) break; if (*q == 0) /* The string is a lone variable name; keep it for now, we -- 2.5.5 --------------070303010503000600090905--