Subject: Re: bug#2062: PATH can contain non-expanded variables

From: Juanma Barranquero <[email-masked]>
Date: Tue, 27 Jan 2009 09:34:26 +0100

On Tue, Jan 27, 2009 at 02:56, Jason Rumney <[email-masked]> wrote:

> The right place to do this expansion is where the variable is read from the
> registry, and only when the type is REG_EXPAND_SZ.

The problem is, we don't read
"HKLM\Software\Microsoft\Windows\CurrentVersion\App
Paths\emacs.exe\Path", we find the PATH made for us and it contains
unexpanded variables.

My patch modifies decode_env_path, because it is used for PATH-like
variables, not generic environment variables. How likely is that such
a PATH-like variable contains a string like %VARIABLENAME%, meaning a
literal "%VARIABLENAME%" directory or filename (or part of it)? That's
a hypothetical problem, while my path containing such a variable is a
fact.

    Juanma