[CMD] Fix delayed expansion of variables.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 4 Jun 2020 00:56:18 +0000 (02:56 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 19 Sep 2020 17:44:55 +0000 (19:44 +0200)
commitcdc8e45b4828b53039646d4c9f50241cfb5d46ee
treef69fd85f69ae579840e9d73db121efaf111092b2
parentcb2a9c31a6c8c207f22852c68fc1464dd3b52080
[CMD] Fix delayed expansion of variables.
CORE-13682

- Split SubstituteVars() into its main loop and a helper SubstituteVar()
  that just substitutes only one variable.

- Use this new helper as the basis of the proper implementation of the
  delayed expansion of variables.

- Fix a bug introduced in commit 495c82cc, when GetBatchVar() fails.
base/shell/cmd/cmd.c
base/shell/cmd/cmd.h