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

From: Juanma Barranquero <[email-masked]>
Date: Tue, 27 Jan 2009 11:25:20 +0100

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

> If the system does not handle REG_EXPAND_SZ in the App Paths registry
> values, then the bug is with whatever incorrectly used that type when
> setting the registry value.

I'd say that Microsoft is of two minds about it, judging by the
entries for msimn.exe (Outlook Express), pbrush.exe (mspaint) and a
few others, that do use REG_EXPAND_SZ.

That said, ExpandEnvironmentStrings is not *specifically* for
REG_EXPAND_SZ registry entries; it is generally useful for cases such
as this one.

So we can either:

  a) consider it as a bug outsize Emacs, and do nothing, or

  b) decide that a variable-like string of the form %VARIABLE% in a
PATH-like value is much, much likely to be that, an unexpanded env
var, than part of a file or directory name, and so expand it.

I'm obviously in camp b), and would like to commit this patch. If
you're strongly on camp a, though, I'll close this bug as notabug +
wontfix.

    Juanma