Commit graph

157 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 7bd33ac4df
[CMD] Addendum to 26ff2c8 and to r40474 / 8cf1106: Fix CMD process exit code.
As it appears, the process exit code of CMD /C is really the errorlevel,
and not the "command's return value".
2017-11-19 00:48:37 +01:00
Hermès Bélusca-Maïto 26ff2c8ef3
[CMD] Fix the errorlevel value set by the EXIT command, and when a batch file has run.
CORE-10495 CORE-13672

- Fix the behaviour of the EXIT command, where it set the last errorlevel
  value ONLY when it was called with the /b switch and otherwise kept the
  ambient one, instead of always using the value that the user specified
  on the command-line.

- When a batch file has terminated, make the Batch() helper returning the
  errorlevel value so that, when the batch file has been started with the
  CALL command, CALL can in turn set the correct errorlevel value.

Verified with respect to Windows' cmd.exe.
2017-11-18 23:52:50 +01:00
Hermès Bélusca-Maïto 24ed534474
[CMD] Code formatting only. 2017-11-18 23:52:50 +01:00
Hermès Bélusca-Maïto 56a19b1439
[CMD] ExecutePipeline() returns the last error level (set to process exit code).
CORE-13974

This should fix situations where (for example):
   command_1 | command_2 && echo Succeeded
should *NOT* run "echo Succeeded" if any of the command_1 or command_2 has
failed.

This also makes the ExecutePipeline() function on par with the other
"ExecuteXXX()" helpers.

Problem diagnosed by Doug Lyons; patch inspired by contributor 'cagey45'.
2017-11-18 20:59:06 +01:00
Hermès Bélusca-Maïto 8340574fe3
[CMD] Fix support for newlines in the emulated parenthesed set block of the "for" command.
CORE-7998
2017-11-17 00:58:45 +01:00
Hermès Bélusca-Maïto cfcca53856
[CMD] Fix '?' command output by adding a missing new-line. CORE-14016
Patch by Doug Lyons.
2017-11-16 21:27:27 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00