Commit graph

6 commits

Author SHA1 Message Date
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 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 ce543fbb72
[CMD] Fix the stop-batch prompt appearance: do not display it more than once in a row. 2020-05-18 02:21:57 +02:00
Hermès Bélusca-Maïto 3f892a8d6b
[CMD] Add missing memory allocation NULL checks (#161). CORE-8304
Adapted from a patch by Jacob S. Preciado.

Bring also the code suggestions emitted during review.
2018-08-21 14:02:24 +02:00
Hermès Bélusca-Maïto a3b36f8d3e
[CMD] Don't reset bCtrlBreak too early.
This allows to break commands such as:

C:\ReactOS\system32> for %f in (*.*) do dir

as one would expect: stop the currently running 'dir' and the 'for'.
"bCtrlBreak" doesn't need to be volatile too.
2018-04-29 00:53:49 +02: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
Renamed from reactos/base/shell/cmd/misc.c (Browse further)