unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, Dmitry Gutov <dgutov@yandex.ru>,
	Andreas Schwab <schwab@linux-m68k.org>
Cc: 23779@debbugs.gnu.org, npostavs@users.sourceforge.net
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	[thread overview]
Message-ID: <57660314.9050907@cs.ucla.edu> (raw)
In-Reply-To: <83vb17c2z3.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

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.)

[-- Attachment #2: 0001-Consing-V-into-process-environment-should-remove-V.patch --]
[-- Type: text/x-patch, Size: 940 bytes --]

From ed5dabd6bb61613649f619f6f210d070812895d7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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


  parent reply	other threads:[~2016-06-19  2:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  3:33 bug#23779: 25.0.95; consing "SHELLVAR" onto process-environment doesn't remove it from subprocess env Noam Postavsky
2016-06-17  7:11 ` Eli Zaretskii
2016-06-17 12:17   ` Dmitry Gutov
2016-06-17 14:01     ` Eli Zaretskii
2016-06-17 14:12       ` Dmitry Gutov
2016-06-17 14:19         ` Eli Zaretskii
2016-06-17 14:47           ` Dmitry Gutov
2016-06-17 16:52             ` Andreas Schwab
2016-06-17 16:55               ` Dmitry Gutov
2016-06-17 17:06             ` Eli Zaretskii
2016-06-17 19:01               ` Dmitry Gutov
2016-06-17 20:10                 ` Eli Zaretskii
2016-06-17 21:26                   ` Dmitry Gutov
2016-06-18  7:51                     ` Eli Zaretskii
2016-06-18  1:36             ` Noam Postavsky
2016-06-18  1:44               ` Dmitry Gutov
2016-06-19  2:27           ` Paul Eggert [this message]
2016-06-19 15:01             ` Eli Zaretskii
2016-06-19 22:53               ` Paul Eggert
2016-06-20 14:21                 ` Eli Zaretskii
2016-06-21 13:53                   ` Dmitry Gutov
2016-06-21 15:21                     ` Eli Zaretskii
2016-06-21 15:24                       ` Dmitry Gutov
2016-06-21 16:12                         ` Eli Zaretskii
2016-06-21 23:05                           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57660314.9050907@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=23779@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).