https://git.reactos.org/?p=reactos.git;a=commitdiff;h=04e0fe0652553b1472d42…
commit 04e0fe0652553b1472d4255fa05f87110b1f1870
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Jul 12 23:27:35 2020 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Aug 19 20:36:12 2020 +0200
[CMD] The "special" environment-like variables are available only when
extensions are enabled.
The "special" variables are: CD, DATE, TIME, RANDOM,
CMDCMDLINE, CMDEXTVERSION, ERRORLEVEL (and on Win7+,
HIGHESTNUMANODENUMBER).
---
base/shell/cmd/cmd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/base/shell/cmd/cmd.c b/base/shell/cmd/cmd.c
index 3a57c04ef33..1cc0a0663f5 100644
--- a/base/shell/cmd/cmd.c
+++ b/base/shell/cmd/cmd.c
@@ -902,7 +902,11 @@ GetEnvVarOrSpecial(LPCTSTR varName)
if (var)
return var;
- /* env var doesn't exist, look for a "special" one */
+ /* The environment variable doesn't exist, look for
+ * a "special" one only if extensions are enabled. */
+ if (!bEnableExtensions)
+ return NULL;
+
/* %CD% */
if (_tcsicmp(varName, _T("CD")) == 0)
{