Revision tags: 0.4.14-release |
|
#
d029a626 |
| 22-May-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[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_wine
[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.
show more ...
|
#
3d4af223 |
| 12-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] CHDIR: Some features are available only when extensions are enabled. Update the SetRootPath() as well.
|
#
47d7de4b |
| 18-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Simplify GetRootPath() and mark its InPath parameter pointer to const string.
|
#
f43ee815 |
| 12-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] CHDIR: Adjust ERROR_FILE_NOT_FOUND into ERROR_PATH_NOT_FOUND if _tchdir() fails.
|
#
ae649656 |
| 11-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[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 GetFul
[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.
show more ...
|
#
2f9b4a2e |
| 11-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] RMDIR: Force directory deletion even if it's read-only, only when recursing over subdirectories (via the /S option).
|
#
5830ccb8 |
| 01-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[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-err
[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"
show more ...
|
#
ca452365 |
| 26-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Some code style and formatting fixes
|
#
82bcb3f9 |
| 07-Aug-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Fix the implementation of EXIT /B when a batch context is active.
|
#
d78e8029 |
| 29-Jul-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Additional fixes for ERRORLEVEL and last returned exit code from EXIT, CALL commands and CMD. CORE-10495 CORE-13672
- Fix how the ERRORLEVEL and the last returned exit code are set by EXIT a
[CMD] Additional fixes for ERRORLEVEL and last returned exit code from EXIT, CALL commands and CMD. CORE-10495 CORE-13672
- Fix how the ERRORLEVEL and the last returned exit code are set by EXIT and CALL commands, when batch contexts terminate, and when CMD runs in single-command mode (with /C).
Addendum to commit 26ff2c8e, and reverts commit 7bd33ac4. See also commit 8cf11060 (r40474).
More information can be found at: https://ss64.com/nt/exit.html https://stackoverflow.com/a/34987886/13530036 https://stackoverflow.com/a/34937706/13530036
- Move the actual execution of the CMD command-line (in /C or /K single-command mode) from Initialize() to _tmain(), to put it on par with the ProcessInput() interactive mode.
- Make ProcessInput() also return the last command's exit code.
show more ...
|
#
6eb1cae3 |
| 18-May-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Fixes for Batch error execution control flow. CORE-13713 CORE-13736
- In case execution of all batch contexts is stopped (by selecting "All" at the Ctrl-C/Ctrl-Break prompt), notify as well
[CMD] Fixes for Batch error execution control flow. CORE-13713 CORE-13736
- In case execution of all batch contexts is stopped (by selecting "All" at the Ctrl-C/Ctrl-Break prompt), notify as well the CheckCtrlBreak() signal handler once there are no more batch contexts (this in effect resets the internal 'bLeaveAll' static flag in CheckCtrlBreak). This is an adaptation of the fix present in FreeCOM 1.5, first described in https://gcfl.net/FreeDOS/command.com/bugs074g.html .
- Introduce a ParseErrorEx() helper that sets the 'bParseError' flag and displays a customized syntax-error message, only for the first syntax error encountered. Implement ParseError() around the *Ex function.
- In batch mode, echo the original pre-parsed batch file line if a parse error has been encountered.
- When running a compound command - including IF, FOR, command blocks -, and that control flow is modified by any CALL/GOTO/EXIT command, detect this while running the compound command so as to stop it and go back to the main batch execution loop, that will then set up the actual new command to run.
- In GOTO, do not process any more parts of a compound command only when we have found a valid label.
show more ...
|
Revision tags: 0.4.15-dev, 0.4.14-RC, 0.4.13-release |
|
#
1b773209 |
| 15-Nov-2019 |
Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> |
[CMD] Unquote string at pushd (#2031)
pushd command of cmd.exe didn't treat the quoted parameter correctly.
- Call StripQuotes in SetRootPath function.
- Fix typo of FEATURE_DIRECTORY_STACK.
This
[CMD] Unquote string at pushd (#2031)
pushd command of cmd.exe didn't treat the quoted parameter correctly.
- Call StripQuotes in SetRootPath function.
- Fix typo of FEATURE_DIRECTORY_STACK.
This PR will enable "Command Prompt" here. CORE-12150
show more ...
|
Revision tags: 0.4.14-dev, 0.4.13-RC, 0.4.12-release, 0.4.12-RC, 0.4.13-dev, 0.4.11-release, 0.4.11-RC, 0.4.12-dev, 0.4.10-release, 0.4.11-dev, 0.4.10-RC, 0.4.9-release, 0.4.10-dev, 0.4.9-RC, 0.4.8-release, 0.4.8-RC, 0.4.9-dev, 0.4.7-release, v0.4.7 |
|
#
26ff2c8e |
| 18-Nov-2017 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[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 wh
[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.
show more ...
|
#
24ed5344 |
| 18-Nov-2017 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[CMD] Code formatting only.
|
Revision tags: 0.4.8-dev, 0.4.7-rc1 |
|
#
c2c66aff |
| 03-Oct-2017 |
Colin Finck <colin@reactos.org> |
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
|
Revision tags: backups/GSoC_2017/rapps@75905, ReactOS-0.4.6, backups/ros-branch-0_4_6@75728, 0.4.7-dev, ReactOS-0.4.5, backups/ros-branch-0_4_5@74569, ReactOS-0.4.4-CLT2017, backups/ReactOS-0.4.4-CLT2017@74182, ReactOS-0.4.4, backups/ros-branch-0_4_4@74002, ReactOS-0.4.4-FOSDEM2017, backups/ReactOS-0.4.4-FOSDEM2017@73667, ReactOS-0.4.3, backups/ros-branch-0_4_3@73437, backups/sndblst@72664, ReactOS-0.4.2, backups/ros-branch-0_4_2@73087, ReactOS-0.4.1, backups/ros-branch-0_4_1@71718 |
|
#
321bcc05 |
| 24-Apr-2016 |
Pierre Schweitzer <pierre@reactos.org> |
Create the AHCI branch for Aman's work
svn path=/branches/GSoC_2016/AHCI/; revision=71203
|
Revision tags: ReactOS-0.4.0-CLT2016, backups/ReactOS-0.4.0-CLT2016@71719, ReactOS-0.4.0-FOSDEM2016, backups/ReactOS-0.4.0-FOSDEM2016@70667, ReactOS-0.4.0, backups/ros-branch-0_4_0@70757, backups/colins-printing-for-freedom@73041, ReactOS-0.3.17-CLT2015, backups/ReactOS-0.3.17-CLT2015@66843, ReactOS-0.3.17, ReactOS-0.3.17-FOSDEM2015, backups/ReactOS-0.3.17-FOSDEM2015@66122, backups/shell-experiments@75904, backups/tcpip_revolution@71025, backups/0.3.17@66124, backups/ros-branch-0_3_16-clt2014@63729 |
|
#
b819608e |
| 02-May-2014 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
Create a branch for console restructuration work.
svn path=/branches/condrv_restructure/; revision=63104
|
Revision tags: ReactOS-0.3.16-CLT2014, ReactOS-0.3.16, backups/ReactOS-0.3.16@62476 |
|
#
527f2f90 |
| 02-Feb-2014 |
Amine Khaldi <amine.khaldi@reactos.org> |
[SHELL/EXPERIMENTS] * Create a branch for some evul shell experiments.
svn path=/branches/shell-experiments/; revision=61927
|
Revision tags: backups/vs_jc@60583, backups/vs_jc@59301 |
|
#
4f0b8d3d |
| 16-Jun-2013 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
|
Revision tags: ReactOS-0.3.15-LT2013, backups/ros-branch-0_3_15-lt2013@59304, ReactOS-0.3.15, backups/ReactOS-0.3.15@59303 |
|
#
e1ef0787 |
| 28-Apr-2013 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
Create this branch to work on loading of different Kernel-Debugger DLL providers, and see whether it is possible to move KDBG from ntoskrnl to a new DLL called, say, KDROSDBG.DLL.
The idea then woul
Create this branch to work on loading of different Kernel-Debugger DLL providers, and see whether it is possible to move KDBG from ntoskrnl to a new DLL called, say, KDROSDBG.DLL.
The idea then would be to have the following behaviour (when specifying the following options in the kernel command line):
/DEBUGPORT=COMi --> load KDCOM.DLL and use COMi port (i == 1,2,3,4) if possible. /DEBUGPORT=FOO --> load KDFOO.DLL (useful for KDUSB.DLL, KD1394.DLL, KDBAZIS.DLL for VirtualKD, etc...) /DEBUGPORT=ROSDBG:[COMi|SCREEN|FILE|GDB|...] --> load KDROSDBG.DLL which contains the ROS kernel debugger, and use COMi or SCREEN or... as output port.
svn path=/branches/kd++/; revision=58883
show more ...
|
Revision tags: backups/ros-csrss@60644 |
|
#
f6f20487 |
| 01-Apr-2013 |
Ziliang Guo <drakekaizer666@gmail.com> |
Branching for 0.3.15 release after two days of no response from a certain sphere of plasma.
svn path=/branches/ReactOS-0.3.15/; revision=58636
|
#
65ce1461 |
| 14-Oct-2012 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
Create a branch for working on csrss and co.
svn path=/branches/ros-csrss/; revision=57561
|
Revision tags: backups/ros-csrss@57560, ReactOS-0.3.14-CLT2012, backups/ros-branch-0_3_14-clt2012@56146, backups/c++-bringup@56084, backups/c++-bringup@60583, backups/usb-bringup-trunk@60667, ReactOS-0.3.14, backups/ros-branch-0_3_14@55492 |
|
#
c2d0d784 |
| 20-Jan-2012 |
Cameron Gutman <aicommander@gmail.com> |
[USB-BRINGUP-TRUNK] - Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup - In the future, DO NOT under any circumstances branch another branch. This lead
[USB-BRINGUP-TRUNK] - Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup - In the future, DO NOT under any circumstances branch another branch. This leads to merge problems!
svn path=/branches/usb-bringup-trunk/; revision=55018
show more ...
|
#
60eea2d7 |
| 19-Jan-2012 |
Amine Khaldi <amine.khaldi@reactos.org> |
* Branch for the 0.3.14 release.
svn path=/branches/ros-branch-0_3_14/; revision=55011
|
Revision tags: backups/wlan-bringup@60693, backups/usb-bringup@55523 |
|
#
2b82fe44 |
| 02-Jan-2012 |
Cameron Gutman <aicommander@gmail.com> |
[WLAN-BRINGUP] - Create a branch to drop my ndisuio work
svn path=/branches/wlan-bringup/; revision=54809
|