GNU bug report logs -
#40949
26.3; substitute-env-in-file-name: Undefined variables not substituted
Previous Next
Reported by: Marcus Harnisch <marcus.harnisch <at> gmx.net>
Date: Tue, 28 Apr 2020 21:01:03 UTC
Severity: normal
Found in version 26.3
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 40949 <at> debbugs.gnu.org (full text, mbox):
> From: Marcus Harnisch <marcus.harnisch <at> gmx.net>
> Date: Tue, 28 Apr 2020 22:38:14 +0200
>
> With commit ee041f2d07b6ed485dc34c115588f973f046c9d4 the function
> `substitute-env-in-file-name' was introduced.
>
> The function substitutes environment variable references in filenames
> with the help of `substitute-env-vars'. On systems that are neither
> windows-nt nor ms-dos, the optional argument to that function is set to
> t with the consequence that references to undefined variables are not
> substituted. This is unexpected, IMHO.
> Expected behaviour would match that of shell expansion, which
> substitutes undefined variables with the empty string.
Your report seems to imply that the behavior on MS-Windows is
different, but it isn't: if the variable is undefined, we leave it
unaltered on those systems as well.
Whether Emacs should follow what the shell does is a separate issue.
In this case, since we use this function in substitute-in-file-name,
what it does should serve what substitute-in-file-name was always
doing: it left the $foo constructs unaltered.
This bug report was last modified 3 years and 345 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.