Commit graph

126 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 895dccd4ac
[CMD] Cleanup all batch contexts if the execution loop stopped due to EXIT. 2020-09-27 20:26:36 +02:00
Hermès Bélusca-Maïto f0fccb752f
[CMD] Fix batch/CALL arguments initialization.
- Move initialization of bc->raw_params also in BatchParams().

- The bc->raw_params, i.e. the unparsed batch/CALL parameters obtained
  with %*, has any leading and trailing whitespace trimmed
  (since Windows 2000+).
2020-09-27 19:06:10 +02:00
Hermès Bélusca-Maïto 37bda06eed
[CMD] CALL: Fix the implementation of the CALL command, make it more compatible with Windows' CMD.
- Fail if no parameter is provided.

- The "CALL :label args..." syntax is available only when command extensions
  are enabled. Fail if this syntax is used outside of a batch context.

- Reparse the CALL command parameter with the command parser, in order
  to accurately parse and interpret it as a possible command (including
  escape carets, etc...) and not duplicate the logic.
  ** CURRENT Windows' CMD-compatibility LIMITATION ** (may be lifted in
  a "ROS-specific" running mode of CMD): only allow standard commands to
  be specified as parameter of the CALL command.

  This reparsing behaviour can be observed in Windows' CMD, by dumping
  the interpreted commands after enabling the cmd!fDumpParse flag from
  a debugger (using public symbols).

- When reparsing, we should tell the parser to NOT ignore lines that
  start with a colon, because in this situation these are to be
  considered as valid "commands" (for parsing "CALL :label").

  * For Windows' CMD-compatibility, the remaining escape carets need to
    be doubled again so that, after the new parser step, they are escaped
    back to their original form. But then we also need to do it the "buggy"
    way à la Windows, where carets in quotes are doubled either! However
    when being re-parsed, since they are in quotes they remain doubled!!
    (see "Phase 6" in https://stackoverflow.com/a/4095133/13530036 ).

  * A MSCMD_CALL_QUIRKS define allows to disable this buggy behaviour,
    and instead tell the parser to not not interpret the escape carets.

- When initializing a new batch context when the "CALL :label" syntax is
  used, ensure that we reuse the same batch file position pointer as its
  parent, so as to have correct call label ordering behaviour.

  That is,

  :label
  ECHO hi
  CALL :label
  :label
  ECHO bye

  should display:

  hi
  bye
  bye

  i.e., the CALL calls the second label instead of the first one (and
  thus entering into an infinite loop).

  Finally, the "CALL :label" syntax strips the first ':' away, so, as a
  side-effect, the command "CALL :EOF" fails (otherwise it would perform
  a "GOTO :EOF" and succeeds), while "CALL ::EOF" succeeds.

Fixes some cmd_winetests.
2020-09-27 19:05:23 +02:00
Hermès Bélusca-Maïto d029a626e9
[CMD] Make the command-line parser more compatible with Windows' CMD one.
All these modifications have been verified with Windows' CMD, either
by using written cmd_rostests and the existing cmd_winetests, or
manually by enabling the flags cmd!fDumpTokens and cmd!fDumpParse
(available in the public symbols) and analyzing how the tokens are
being parsed, as well as the generated command tree.

See also the following links for more details (but remember that these
observations have to be double-checked in Windows' CMD!):

* Parser rules: https://stackoverflow.com/a/4095133/13530036
* Discussion: https://www.dostips.com/forum/viewtopic.php?f=3&t=8355
* Numbers parsing: https://www.dostips.com/forum/viewtopic.php?t=3758
* Label names vs. GOTO and CALL: https://www.dostips.com/forum/viewtopic.php?f=3&t=3803
  and: https://www.dostips.com/forum/viewtopic.php?f=3&t=3803&p=55405#p55405

- Fix REM command parsing. A C_COMMAND-like structure should still
  be built, so that it can show up during batch command echo. However
  some specific handling needs to be done, so use instead a new C_REM
  command type.
  Escape carets are parsed differently than usual: they are explicitly
  kept in the command line and don't participate in line continuations.
  Also, the Windows' CMD behaviour is to discards everything before the
  last line continuation.

- Prefix operator '@' (the "silent" operator) is parsed as a separate
  command. Thus, the command @@foo@bar is parsed as: '@', '@', 'foo@bar'.

- Improve the checks for numbered redirection.
  For this purpose, we check whether this is a number, that is in first
  position in the current parsing buffer or is preceded by a whitespace-
  like separator, including standard command operators (excepting '@' !)
  and double-quotes.

- Empty command blocks, i.e. "( )", standing by themselves, or present
  in IF or FOR commands, are considered invalid. (The closing parenthesis
  is considered "unexpected".)

- Ignore single closing parenthesis when being outside of command blocks,
  thus interpreting it as a command, and ignore explicitly everything
  following on the same line, including line continuations.
  This very specific situation can happen e.g. while running in batch mode,
  when jumping to a label present inside a command block.
  See the code for a thorough explanation.

- Detect whether a parenthesized block is not terminated at the end
  of a command stream (getting a NUL character instead of a newline),
  and if so, bail out early instead of entering into an infinite loop.

- Perform a similar check for the parenthesized list in FOR commands.

- Initialize the static 'InsideBlock' value to a known value.

- The '&' operator (multi-commmand) is allowed to have an empty RHS.
  When such situation occurs, turn the CurrentTokenType to TOK_END
  so as to avoid a parse error later on.

- The main body of a IF statement, or its 'else' clause, as well as
  the main body of a FOR statement, must not be empty, otherwise this
  is considered a syntax error. If so, call ParseError() that sets
  the 'bParseError' flag, and forcing all batch execution to stop.
2020-09-27 02:27:15 +02:00
Hermès Bélusca-Maïto 17e094cd34
[CMD] SET: Diverse fixes for the arithmetic-expression parser (/A option).
- Detect whether a division by zero is done, and fail if so.

- Detect whether an invalid number is provided:
  * If _tcstol() fails with errno == ERANGE, we've got an overflow or
    underflow.
  * If the next character where _tcstol() is not a whitespace but is a
    character compatible with the first character of an identifier, the
    number is invalid.

- Add + to the list of existing unary operators (!,~,-), and parse them
  where many of these are present. Indeed, expressions like: +3, -+-+3,
  !!-+3 (or with other unary ops, etc.) are valid.

- Operators constituted of more than one characters, can contain
  whitespace separating their constituting characters.
  Thus, "a + = 3" is equivalent to "a += 3" (and the same for -=, *=,
  /=, %=, &=, |= and ^=), and "a < < 3" is equivalent to "a << 3" (and
  the same for >>, <<= and >>=).

- After evaluating everything, if unparsed data remains, fail and bail out.

- Return Windows' CMD-compatible errorlevels.

See https://ss64.com/nt/set.html for more details.

Fixes some cmd_winetests.
2020-09-23 00:22:48 +02:00
Hermès Bélusca-Maïto 87a5403318
[CMD] Add a MSCMD_BATCH_ECHO define for enabling Windows' CMD.EXE way of preserving/restoring the echo flag across batch calls.
Observation shows that this is done only when the top-level batch file
is being run (and then terminates); the echo flag is not restored to its
previous state when a child batch file terminates and gives main back to
its parent batch.
2020-09-23 00:22:47 +02:00
Hermès Bélusca-Maïto 141378cfc8
[CMD] ASSOC: Simplify the code and make it more robust; fix returned ERRORLEVEL values.
- Make sure that non-administrator users can list associations, and
  display appropriate error messages when e.g. they don't have sufficient
  privileges to perform an operation.

- Make the helper functions all return Win32 values, used as the
  ERRORVALUE, except when a specific extension association fails to be
  displayed, in which case the ERRORVALUE is normalized to 1.

- Since the 'param' is a modifiable string (that can be modified by the
  command, independently of the way it's called), just use it to isolate
  the extension by zeroing out the equls-sign separator.
2020-09-23 00:22:47 +02:00
Hermès Bélusca-Maïto 63316df520
[CMD] Change ERRORLEVEL behaviour for commands ASSOC, PATH, PROMPT and SET.
Commands APPEND/DPATH and FTYPE are also concerned by this; however
we do not implement them in our CMD.EXE yet.

These commands set the ERRORLEVEL differently, whether or not they are
run manually from the command-line/from a .BAT file, or from a .CMD file:

- From command-line/.BAT file, these commands set the ERRORLEVEL only if
  an error occurs. So, if two commands are run consecutively and the first
  one fails, the ERRORLEVEL will remain set even if the second command
  succeeds.

- However, when being run from a .CMD file, these command will always
  set the ERRORLEVEL. In the example case described above, the second
  command that succeeds will reset the ERRORLEVEL to 0.

This behaviour is determined from the top-level batch/script file being
run. This means that, if a .BAT file is first started, then starts a
.CMD file, the commands will still behave the .BAT way; on the opposite,
if a .CMD file is first started, then starts a .BAT file, these commands
will still behave the .CMD way.

To implement this we introduce one global BATCH_TYPE enum variable that
is initialized to the corresponding batch/script file type when the
top-level script is loaded. It is reset to "none" when that script
terminates.

See https://ss64.com/nt/errorlevel.html for more details,
section "Old style .bat Batch files vs .cmd Batch scripts",
and https://groups.google.com/forum/#!msg/microsoft.public.win2000.cmdprompt.admin/XHeUq8oe2wk/LIEViGNmkK0J
(comment by Mark Zbikowski).
2020-09-23 00:22:46 +02:00
Hermès Bélusca-Maïto a5d7a2cd61
[CMD] Code style and formatting fixes for assoc.c and path.c 2020-09-23 00:22:45 +02:00
Hermès Bélusca-Maïto 0695ecbfd6
[CMD] FOR: Additional Windows' CMD compatibility "fixes" for FOR /F token parsing command.
This compatibility behaviour implements the buggy behaviour of FOR /F
token parsing that can be observed in Windows' CMD, and that is tested
by the cmd_winetests.
It can be disabled at compile time via the MSCMD_FOR_QUIRKS define.

It fixes additional cmd_winetests, in concert with commit cb2a9c31.

Explanation of the implemented buggy behaviour
==============================================

In principle, the "tokens=x,y,m-n[*]" option describes a list of token
numbers (must be between 1 and 31) that will be assigned into variables.
Theoretically this option does not cumulate: only the latest 'tokens='
specification should be taken into account.

However things are not that simple in practice. First, not all of the
"tokens=" option state is reset when more than one specification is
provided. Second, when specifying a token range, e.g. "1-5", Windows'
CMD just ignores without error ranges that are not specified in
increasing order. Thus for example, a range "5-1" is ignored without
error. Then, token numbers strictly greater than 31 are just ignored,
and if they appear in a range, the whole range is ignored.

Another bug is the following one: suppose that the 'tokens'
specification reads:
  "tokens=1-5,1-30" , or: "tokens=1-5,3" ,
i.e. more than one range, that overlap partially. Then the actual total
number of variables will not be of the larger range size, but will be
the sum, instead.
Thus, in the first example, a total of 5 + 30 == 35 variables (> 31) is
allocated, while in the second example, a total of 5 + 1 == 6 variables
is allocated, even if they won't all store data !!
In the first example, only the first 30 FOR variables will be used, and
the 5 others will contain an empty string. In the second example, only
the first 5 FOR variables will be used, and the other one will be empty.

We also see that due to that, the "Variables" buffer of fixed size
cannot always be used (since it can contain at most 32 variables).

Last but not least, when more than one "tokens=" specification is
provided, for example:
  "tokens=1-31 tokens=1-20"
a total number of 31 FOR variables (because 31 is the max of 31 and 20)
is allocated, **but** only 20 are actually used, and the 11 others
return an empty string.

And in the specification: "tokens=1-31,* tokens=1-20", a total of
31 + 1 + 20 = 52 variables is initialized, but only the first 20 will
be used, and no "remaining-line" token (the '*' one) is used.
2020-09-21 03:31:01 +02:00
Hermès Bélusca-Maïto e904471023
[CMD] IF: Fix x64 warning C4267. 2020-09-21 03:31:01 +02:00
Hermès Bélusca-Maïto 5d5a1a455c
[CMD] FOR: Fix a bug when parsing the "delims=" option in FOR loops.
Suppose the following FOR-loop command, to be run from the command-line
(if using a batch file, double each percent '%' sign):

  FOR %l IN ("a,b,c,d,e" "f,g,h,i,j") DO (
    FOR /F "delims=, tokens=1-3*" %a IN (%l) DO @echo %a-%b-%c-%d
  )

The outermost FOR-loop enumerates the two strings "a,b,c,d,e" and
"f,g,h,i,j" (placed in %l), and parse each of these in turn, splitting
them at each specified delimiter (here only one character) ',' and storing
the results in consecutive tokens %a, %b, %c, %d, with the last token %d
containing all the remaining string (non-split).
The expected result is:

  a-b-c-d,e
  f-g-h-i,j

However, due to the way the delimiters string specified by the "delims="
option is stored (no stack/heap duplication of the FOR-option substring,
but reading from it directly), during the first run of the innermost
FOR-loop, the option string "delims=, tokens=1-3*" was truncated to just
after the ',' due to the erroneous "delims=" parsing, so that when this
FOR-loop ran for a second time (to deal with the second string), the option
string was already erroneously truncated, without the "tokens=..." part,
so that the parsing results were not stored in the tokens and resulting in:

  a-b-c-d,e
  f-%b-%c-%d

instead. The solution is to save where the "delims=" string needs to be
cut, but wait until running the actual FOR-loop to terminate it (and
saving the original character too), run the FOR-loop body, and then
restore the original character where termination took place. This allows
having the FOR-loop option string valid for the next execution of the
FOR-loop.
2020-09-19 19:44:56 +02:00
Hermès Bélusca-Maïto 5cf0517be1
[CMD] Code formatting in SubstituteVar(). 2020-09-19 19:44:55 +02:00
Hermès Bélusca-Maïto cdc8e45b48
[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.
2020-09-19 19:44:55 +02:00
Hermès Bélusca-Maïto cb2a9c31a6
[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.
2020-09-19 19:44:54 +02:00
Kyle Katarn ac2b2ef8c7
[CMD] HISTORY: Fix command output (missing linefeed) (#3205)
CORE-12603

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-09-18 00:17:08 +02:00
Hermès Bélusca-Maïto c58a601602
[CMD] Document the two extra file attributes the enhanced batch/FOR variables %~aX could handle on Windows >= 8.
They are currently specified for documentation purposes (i.e. what
Windows 8+ CMD.EXE can report) but not used yet, since ReactOS does not
support them.
2020-09-13 22:50:11 +02:00
Hermès Bélusca-Maïto 95466904db
[CMD] SHIFT: Use _istdigit(). 2020-09-13 22:50:10 +02:00
Hermès Bélusca-Maïto 00ce3c48fe
[CMD] Use pointers to const strings in error functions, where applicable. 2020-09-13 22:50:09 +02:00
Hermès Bélusca-Maïto 3f8f3a2bba
[CMD] Minor formatting only. 2020-09-13 22:50:09 +02:00
Hermès Bélusca-Maïto 050df0f56d
[CMD] Code formatting for IsValidPathName, IsExistingFile, IsExistingDirectory, and use INVALID_FILE_ATTRIBUTES instead of an hardcoded value. 2020-09-04 00:24:45 +02:00
Hermès Bélusca-Maïto c81bf4f823
[CMD] IF: Add extra validity checks in ExecuteIf(). 2020-09-03 16:05:55 +02:00
Catalin Gabriel Draghita 0ab63f9590
[BASE] Improve Spanish (es-ES) translation (#3088) 2020-08-25 18:10:23 +03:00
Adam Stachowicz ca68686a98
[CMD] Update Polish (pl-PL) translation (#3082)
Addendum to 7c175d4.
2020-08-20 12:25:52 +03:00
Stanislav Motylkov fa120ac0cd
[CMD] Update Russian (ru-RU) translation
Addendum to 7c175d4.
2020-08-20 02:04:17 +03:00
Hermès Bélusca-Maïto 6925ca37ab
[CMD] Add mention of the /Y switch in MORE command help; re-position the STRING_PAUSE_HELP1 string. 2020-08-19 21:39:23 +02:00
Hermès Bélusca-Maïto 6a8754c83a
[CMD] TYPE: Rewrite the command so as to fix some of its behaviour.
- Display the names of the files being TYPEd only if more than one file
  has been specified on the command-line, or if a file specification
  (with wildcards) is present (even just for one).
  These names are displayed on STDERR while the files are TYPEd on
  STDOUT, therefore allowing concatenating files by just redirecting
  STDOUT to a destination, without corrupting it with the displayed file
  names. Also, add a /N option to force not displaying these file names.

- When file specifications (with wildcards) are being processed, silently
  ignore any directories matching them. If no corresponding files have
  been found, display a file-not-found error.

- When explicitly directory names are specified, don't do any special
  treatment; the CreateFile() call will fail and return the appropriate
  error.

- Fix the returned errorlevel values.

See https://ss64.com/nt/type.html for more information.

Fixes some cmd_winetests.

- When reading from a file, retrieve its original size so that
  we can stop reading it once we are beyond its original ending.
  This allows avoiding an infinite read loop in case the output of
  the file is redirected back to it.

  Fixes CORE-17208

- Move the FileGetString() helper to the only file where it is
  actually used.
2020-08-19 21:39:22 +02:00
Hermès Bélusca-Maïto 3d4af22328
[CMD] CHDIR: Some features are available only when extensions are enabled. Update the SetRootPath() as well. 2020-08-19 21:39:21 +02:00
Hermès Bélusca-Maïto fe9aa42d5f
[CMD] SET: Fix displaying the environment variables with a given prefix.
- Restore any truncated space in the name prefix, before displaying
  any error message.

- When trimming the name prefix from "special" characters (spaces, comma
  and semicolon), so that e.g. "set ,; ,;FOO" displays all the variables
  starting by "FOO", save also a pointer to the original name prefix, that
  we will use for variables lookup as well.

  This is done, because the SET command allows setting an environment variable
  whose name actually contains these characters (e.g. "set ,; ,;FOO=42"),
  however, by trimming the characters, doing "set ,; ,;FOO" would not allow
  seeing such variables.
  With the fix, it is now possible to show them.
2020-08-19 21:39:18 +02:00
Hermès Bélusca-Maïto 8cea82b14c
[CMD] REPLACE: Fix a memory leak. 2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto 1cb7e08522
[CMD] SETLOCAL / ENDLOCAL: Save / Restore as well the current drive and current directory.
That's an actual fact, done on original MS-DOS COMMAND.COM, FreeCOM,
Windows' CMD.EXE, etc., but is strangely undocumented on MSDN documentation.

See https://www.dostips.com/forum/viewtopic.php?t=4436

Fixes some cmd_winetests.
2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto e8e31267c5
[CMD] setlocal.c : Code style and formatting fixes 2020-08-19 20:36:13 +02:00
Hermès Bélusca-Maïto 90159e1e51
[CMD] Implement provisional support for the HIGHESTNUMANODENUMBER environment-like variable.
This variable is available only in Win7+, even if the underlying API
GetNumaHighestNodeNumber() is available in Win2003+
2020-08-19 20:36:12 +02:00
Hermès Bélusca-Maïto 04e0fe0652
[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).
2020-08-19 20:36:12 +02:00
Hermès Bélusca-Maïto 41a93a4e58
[CMD] FOR: Some functionality is available only when extensions are enabled.
This is basically all the advanced functionality enabled with the /D,
/R, /L and /F flags, and the usage of enhanced variables.
2020-08-19 20:36:11 +02:00
Hermès Bélusca-Maïto fedc68aea8
[CMD] IF: Some functionality is available only when extensions are enabled.
This functionality is: case insensitivity comparisons (/I);
CMDEXTVERSION and DEFINED unary operators; EQU, NEQ, LSS, LEQ, GTR, GEQ
generic string comparators.
2020-08-19 20:36:11 +02:00
Hermès Bélusca-Maïto 80844dc185
[CMD] DATE: Simplify the input loop, based on the TIME command.
Set also the ERRORLEVEL in case of error.
2020-08-19 20:36:10 +02:00
Hermès Bélusca-Maïto a151893351
[CMD] DATE: The /T option is available only when extensions are enabled. 2020-08-19 20:36:10 +02:00
Hermès Bélusca-Maïto 682875d070
[CMD] TIME: The /T option is available only when extensions are enabled.
And merge two string buffers into one.
2020-08-19 20:36:09 +02:00
Hermès Bélusca-Maïto aab632644f
[CMD] Some code style and formatting fixes 2020-08-19 20:36:09 +02:00
Hermès Bélusca-Maïto 47d7de4b7b
[CMD] Simplify GetRootPath() and mark its InPath parameter pointer to const string. 2020-08-19 20:36:08 +02:00
Hermès Bélusca-Maïto f43ee81573
[CMD] CHDIR: Adjust ERROR_FILE_NOT_FOUND into ERROR_PATH_NOT_FOUND if _tchdir() fails. 2020-08-19 20:36:08 +02:00
Hermès Bélusca-Maïto 9871becced
[CMD] It is not the job of ErrorMessage() to set the errorlevel! It is set only by the commands that want it. 2020-08-19 20:36:08 +02:00
Hermès Bélusca-Maïto 3b960a1c21
[CMD] MOVE: Set the errorlevel on failure.
CORE-14261
2020-08-19 20:36:07 +02:00
Hermès Bélusca-Maïto ae649656db
[CMD] RMDIR: Improve some aspects of the /S option.
- First, the option and the APIs called by it can work directly on
  paths relative to the current directory. So there is no need to
  call GetFullPathName(), with the risk of going over MAX_PATH if the
  current path is quite long (or nested) but the RMDIR is called on a
  (short-length) relative sub-directory.

- Append a path-separator (backslash), only if the specified directory
  does not have one already, and, that it does not specify a current
  directory via the "drive-root" method, e.g. "C:" without any trailing
  backslash.

- In case there are errors during deletion of sub-directories or
  sub-files, print the error but continue deleting the other sub-dirs
  or files.

- Monitor the Ctrl-C breaker as well, and stop deleting if it has been
  triggered.

- When removing file/directory read-only attribute, just remove this
  attribute, but keep the other ones.

- When deleting the directory, first try to do it directly; if it fails
  with access denied, check whether it was read-only, and if so, remove
  this attribute and retry deletion, otherwise fails.

- When recursively deleting a drive root directory, ultimately resolve
  the dir pattern and check whether it's indeed a drive root, e.g.
  "C:\\", and if so, just return success. Indeed, calling
  RemoveDirectory() on such drive roots will return ERROR_ACCESS_DENIED
  otherwise, but we want to succeed even if, of course, we won't
  actually "delete" the drive root.
2020-08-19 20:36:07 +02:00
Hermès Bélusca-Maïto 2f9b4a2e9f
[CMD] RMDIR: Force directory deletion even if it's read-only, only when recursing over subdirectories (via the /S option). 2020-08-19 20:36:06 +02:00
Hermès Bélusca-Maïto 7c175d4999
[CMD] PATH, SET: Fix the returned error message when an environment variable does not exist.
Translators, please update the translations!
2020-08-19 20:36:06 +02:00
Hermès Bélusca-Maïto 6e09a6a3ff
[CMD] Use kernel32!lstrcmp(i) when comparing strings with the IF command.
Use kernel32!lstrcmp(i) instead of CRT!_tcs(i)cmp, so as to use the correct
current thread locale information when comparing user-specific strings.
As a result, the following comparison: 'b LSS B' will return TRUE,
instead of FALSE as it would be by using the CRT functions (and by
naively considering the lexicographical order in ANSI).
This behaviour has been introduced in Windows 2000 onwards.
2020-08-19 20:36:05 +02:00
Hermès Bélusca-Maïto 5830ccb85e
[CMD] Improve the way the ErrorMessage() helper and the MKDIR and RMDIR commands report their errors.
For MKDIR, also properly support the case of ERROR_FILE_EXISTS and
ERROR_ALREADY_EXISTS last-errors by displaying the standard error
"A subdirectory or file XXX already exists.\n"
2020-08-19 20:36:05 +02:00
Hermès Bélusca-Maïto 1efbcd3d5d
[CMD] Improve RMDIR help and MD error message. 2020-08-19 20:36:04 +02:00