[CMD] Some fixes for getting the enhanced '%~XXX' batch/FOR variables.

CORE-11857 CORE-13736

It will be followed with a separate fix for the FOR-loop code.
Fixes some cmd_winetests.

A NULL pointer can be returned for a valid existing batch/FOR variable,
in which case the enhanced-variable getter should return an empty string.
This situation can happen e.g. when forcing a FOR-loop to tokenize a
text line with not enough tokens in it.
This commit is contained in:
Hermès Bélusca-Maïto 2020-07-04 17:40:58 +02:00
parent 014efdf7e8
commit cb2a9c31a6
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 146 additions and 58 deletions

View file

@ -44,7 +44,12 @@ extern BOOL bEcho; /* The echo flag */
extern TCHAR textline[BATCH_BUFFSIZE]; /* Buffer for reading Batch file lines */
LPTSTR FindArg(TCHAR, BOOL *);
BOOL
FindArg(
IN TCHAR Char,
OUT PCTSTR* ArgPtr,
OUT BOOL* IsParam0);
VOID ExitBatch(VOID);
VOID ExitAllBatches(VOID);
INT Batch(LPTSTR, LPTSTR, LPTSTR, PARSED_COMMAND *);