Subject: bug#2259: 23.0.90; PATCH: getenv mistakenly passes a frame to getenv_internal, when it should instead pass a CONS

From: Juanma Barranquero <[email-masked]>
Date: Tue, 10 Feb 2009 17:10:20 +0100

On Tue, Feb 10, 2009 at 11:24, Juanma Barranquero <[email-masked]> wrote:

> or it
> is known at that point that the ENV arg of `server-with-environment'
> will never contain negative entries (i.e., can the output of
> (process-get process 'env) contain negative entries)? If it is
> intended, perhaps a comment would be in order.

OK, I see now that "ENV should be in the same format as
`process-environment'", and that, in `process-environment', "[e]ach
element should be a string of the form ENVVARNAME=VALUE". So yes, it
is known that there shouldn't be negative entries, and it is even
documented.

Still, perhaps this change would be useful...

    Juanma

Index: server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.188
diff -u -2 -r1.188 server.el
--- server.el	7 Feb 2009 21:59:35 -0000	1.188
+++ server.el	10 Feb 2009 15:55:04 -0000
@@ -241,7 +241,7 @@
        (dolist (,var ,vars)
          (let ((,value (getenv-internal ,var ,env)))
-           (push (if (null ,value)
-                     ,var
-                   (concat ,var "=" ,value))
+           (push (if (stringp ,value)
+                     (concat ,var "=" ,value)
+                   ,var)
                  process-environment)))
        (progn ,@body))))