Commit graph

113 commits

Author SHA1 Message Date
Eric Pouech
23817bb8d9 cmd: Bail out when full path name exceeds MAX_PATH.
This mimics native behavior and prevents buffer overflows.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Gijs Vermeulen
0bf71745f0 cmd: Use terminated strings.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48486
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-15 17:41:40 +02:00
Jacek Caban
2ecb871310 cmd: Don't use WCMD_is_console_handle.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 19:50:20 +01:00
Michael Stefaniuc
9fcb2b097c cmd: Inline some simple extern WCHAR strings.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 21:36:12 +01:00
Zebediah Figura
16c938cb66 cmd: Fix the spelling of "tilde".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 11:32:05 +02:00
Zebediah Figura
60b3db6b98 cmd: Use _wsplitpath() from msvcrt.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 11:32:03 +02:00
Brendan Shanks
e8f16fcbcc cmd: Use RtlGetVersion to fix displayed Windows version on Win8.1 or 10 prefix.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Francois Gouget
ecdc4daccf cmd: Fix the spelling of a WINE_TRACE() message and a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-09 23:47:46 +01:00
Bernhard Übelacker
f238e846e7 cmd.exe: Change parsing of the if command to avoid parsing the operators.
Found while trying to look into bug 44236.
A batch script is executed containing a line like this:
  if (%1)==(p) start /W  " "  "%SFDIR%WSFplot" wr2300.t35 3

This returns an error like this:
  Syntax error
  Can't recognize 'p' as an internal or external command, or batch script.

It looks like native does handle the brackets differently when contained
inside the condition part of the if command.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44338
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-23 22:12:09 +02:00
Alexandre Julliard
43c430a6d8 cmd: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-03 16:30:39 +02:00
Michael Stefaniuc
44bda237ed cmd: Avoid naming conflicts with the global HeapAlloc wrappers.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:21:39 +01:00
Jason Edmeades
dce5f89e48 cmd: Expand the storage space for qualifiers.
When parsing a command, after the first '/' we store the characters away
in quals. The command itself can be MAXSTRING in bytes, but the quals was
limited to MAX_PATH. This is incorrect, as you can provide very long
qualifiers as well. Expand the space to allow the maximum size possible.

Signed-off-by: Jason Edmeades <us@edmeades.me.uk>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-16 09:19:04 +02:00
Alistair Leslie-Hughes
21ade8538d cmd: Implement builtin mklink command.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-14 20:45:44 +01:00
Alexandre Julliard
bcb6bf98e0 cmd: Use WINAPIV calling convention for variadic functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-02 10:20:52 +01:00
Bas Weelinck
9baceabb88 cmd: Detect and handle start console title.
Signed-off-by: Bas Weelinck <bas.weelinck@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-17 22:21:12 +02:00
Alexandre Julliard
3d3c5ab400 cmd: Add a helper function to check if a path ends with a backslash. 2014-10-30 13:11:27 +09:00
Jason Edmeades
56a33a8c55 cmd: set "var=value" ignores trailing characters. 2013-06-05 11:45:19 +02:00
Jason Edmeades
0b00b717b9 cmd: Add beginnings of support for delayed expansion. 2013-01-07 11:15:23 +01:00
Ann and Jason Edmeades
95279b87e4 cmd: Add set /a support. 2012-12-21 12:00:19 +01:00
Jacek Caban
08c17ada57 cmd: Added HeapFree wrapper. 2012-11-16 11:40:36 +01:00
Jacek Caban
c6d24089db cmd: Make allocation unfailable. 2012-11-15 21:21:53 +01:00
Jason Edmeades
ae4571fb79 cmd: Fix for loops within for loops. 2012-11-06 16:02:41 +01:00
Frédéric Delanoy
16d5f457e2 cmd: Display a clearer error message for not found commands. 2012-10-26 16:42:34 +02:00
Frédéric Delanoy
cee1652e61 cmd: Get rid of longer needed 'end' parameter in WCMD_parameter. 2012-10-26 11:59:58 +02:00
Jason Edmeades
51b0d941d0 cmd: Add for /f delims= support. 2012-10-24 11:30:43 +02:00
Jason Edmeades
3c05818515 cmd: Add support for calling a built in command. 2012-10-17 11:59:34 +02:00
Jason Edmeades
9f83165efb cmd: Rename parameter passed to builtin calls. 2012-10-17 11:57:35 +02:00
Jason Edmeades
dccccfc273 cmd: Handle very odd delimiter support for command line. 2012-10-17 11:57:23 +02:00
Jason Edmeades
89b8868ae0 cmd: Rework parameter parsing for WCMD_Copy. 2012-10-15 15:25:07 +02:00
Jason Edmeades
c55cd87632 cmd: Fix setlocal/endlocal implementation. 2012-10-01 14:30:49 +02:00
Jason Edmeades
e35b239b41 cmd: Fix parameterization around delimiters. 2012-09-26 17:47:20 +02:00
Frédéric Delanoy
0e4ceb9a8d cmd: Use BOOL instead of int for boolean variables. 2012-03-29 20:49:18 +02:00
Frédéric Delanoy
668e44ab26 cmd: Respect constant wide strings naming convention. 2012-02-13 12:29:34 +01:00
Alexandre Julliard
3c8d8f1e95 cmd: START needs to be an internal command. 2012-02-11 16:12:01 +01:00
Francois Gouget
af3d368aca cmd: Fix an internationalization issue in WCMD_ask_confirm().
Don't break the strings to translate in little chunks: this makes it
hard or even impossible to translate them correctly. For instance it
must be possible to insert an unbreakable space before question marks
for French.
2012-01-23 19:42:54 +01:00
Akihiro Sagawa
8a00eb8609 cmd: Improve the message when the volume has no label. 2011-12-15 17:46:31 +01:00
Francois Gouget
8ef901fa32 cmd: Use FormatMessage() for better internationalization support.
This makes it possible to reorder the format string placeholders in message translations.
2011-12-06 18:23:49 +01:00
Frédéric Delanoy
44a1e7d199 cmd: Move commonly used global vars declarations to header file. 2011-11-30 11:44:05 +01:00
Frédéric Delanoy
de7841b2ce cmd: Move builtins list to builtins.c. 2011-11-21 15:34:58 +01:00
Frédéric Delanoy
5fc25686a4 cmd: Avoid duplication of commonly used strings. 2011-11-15 11:45:58 +01:00
Frédéric Delanoy
6221e300bc cmd: Avoid comparison between signed and unsigned values. 2011-11-08 13:55:14 +01:00
Frédéric Delanoy
6d01f15a27 cmd: Rename a parameter in WCMD_parameter. 2011-10-31 16:48:33 +01:00
Frédéric Delanoy
42f126e80d cmd: Constify WCMD_pushd parameter. 2011-10-21 12:31:46 +02:00
Frédéric Delanoy
d19455e895 cmd: Rename WCMD_opt_s_strip_quotes function. 2011-10-19 16:38:52 +02:00
Frédéric Delanoy
5e3cb1867b cmd: Infer handle type from handle value in WCMD_fgets and WCMD_ReadAndParseLine. 2011-10-06 16:46:41 -05:00
Frédéric Delanoy
d25f614c51 cmd: Rename a parameter in WCMD_fgets. 2011-10-05 17:00:12 -05:00
Frédéric Delanoy
29b57ca82d cmd: Get rid of unused parameter in WCMD_ReadFile. 2011-09-28 17:29:24 +02:00
Frédéric Delanoy
d6f4f7308a cmd: Avoid checking whether we're in console mode for every read. 2011-09-28 17:29:10 +02:00
Frédéric Delanoy
fbddecab77 cmd: Add WCMD_output_stderr function to output error messages to stderr. 2011-09-26 22:42:01 +02:00
Frédéric Delanoy
a536004f34 cmd: Improve WCMD_volume documentation. 2011-09-23 12:43:53 +02:00