Commit graph

31 commits

Author SHA1 Message Date
Amine Khaldi d12708671c [BASE] Spelling fixes by Josh Soref. CORE-12286
svn path=/trunk/; revision=73133
2016-11-05 14:55:55 +00:00
Hermès Bélusca-Maïto b408826a0b [CMD]
- Improve the screen pager so that it looks a bit more like MORE's one: display full screen pages, where only the last line contains the "press any key..." prompt, and erase this prompt when a key is pressed and before displaying the other screen page.
- GetScreenSize parameters are pointers (so use NULL instead of 0);
- Use ARRAYSIZE instead of hardcoding buffer number of elements;
- Simplify PrintInfoLine() (use read-only resource string buffer returned by LoadString instead of a temporary buffer, since we are just interested in the counted string).

svn path=/trunk/; revision=72955
2016-10-10 19:15:07 +00:00
Hermès Bélusca-Maïto 01dccc57d3 [CMD]
- Do not hardcode the length of the string arrays in the LoadString calls (use ARRAYSIZE instead)
- Localize the command prompt info line. CORE-9293 #resolve #comment I placed the string in the resource files so that you can now localize it!

svn path=/trunk/; revision=66518
2015-03-01 12:28:38 +00:00
Amine Khaldi 7e7dd3324e [CMD]
* Plug a memory leak. Based on a patch by Samuel Serapion.
CORE-7297 #resolve #comment Fixed in r59611. Thanks.

svn path=/trunk/; revision=59612
2013-08-01 15:40:34 +00:00
Hermès Bélusca-Maïto 1965b2bf85 [CMD]
Remove extra \r put by hand in some console output functions, so that we use there only \n.
But modify the ConWrite function so that, if we redirect output to something else than a console
(e.g. redirect to a file or to a serial console via ... > AUX), newline characters \n get converted
into \r\n automatically.

What you get, for instance, is: https://imageshack.com/a/img853/5834/l34.png

svn path=/trunk/; revision=59411
2013-07-02 23:07:15 +00:00
Hermès Bélusca-Maïto 523f0d4f97 [CMD]
Yet again some whitespace fixes.

svn path=/trunk/; revision=59396
2013-06-30 16:10:54 +00:00
Hermès Bélusca-Maïto d40eb536e9 [CMD]
Fix some people's names presentation

svn path=/trunk/; revision=59390
2013-06-30 13:23:30 +00:00
Hermès Bélusca-Maïto 3f69dc1614 [CMD]
Fix whitespace (part 4/x) (convert tabs into 4-space indent).

svn path=/trunk/; revision=59383
2013-06-30 12:27:18 +00:00
Amine Khaldi 2bd930547c * Slap *some* sense into our header inclusions.
* This significantly shrinks the dependency tracking data and the compiled objects size, which speeds up the whole build process (especially the incremental builds) accelerating the daily development as a result.
* No intended code changes, ~27% smaller build. Enjoy ;)

svn path=/trunk/; revision=58214
2013-01-24 23:00:42 +00:00
Timo Kreuzer ece4aa3f3f [CMD]
Handle the + character only optionally as a token seperator, so that other commands like rename are not affected.

svn path=/trunk/; revision=56349
2012-04-14 21:35:58 +00:00
Timo Kreuzer 49a81a2b04 [CMD]
Fix several bugs in the copy command:
- "x:" is not a valid source path (see bug #5709)
- when appending files using "+", cmd must distinguish between + as operator and + as part of the source file, when being put in "". For that reason the tokenizer was modified to make + a seperate token, which is replaced with | when creating the string of multiple files (since + is a valid file character)
- ? was not correctly handled when passed in the output file name
- factor out the code to create the file name from wildcards and make it readable (no, p, q, r are NOT reasonable variable names!)
- Move code out of the loop that doesn't belong there
- Make sure the file names are printed when multiple files are copied or appended
- write the count of written files (which is 1 when appending), not source files after the copy process is done
- Remove an excessive newline when writing strings with ConPuts()
- Improve readability a bit

svn path=/trunk/; revision=56346
2012-04-14 20:57:38 +00:00
Timo Kreuzer 00b699d98b [CMD]
Fix MSVC / 64 bit warnings

svn path=/trunk/; revision=56258
2012-03-28 09:50:04 +00:00
Stefan Ginsberg 93109445ba - npapi.h: Correct definitions of function pointer prototypes.
- ntifs.h & cmdata.h : Don't use array size of 0. Fixes C4200.
- wdm.h: Correct definition of 64-bit SLIST_HEADER. Add explicit casts to avoid /W4 warnings in RtlEnlargedUnsignedDivide.
- winddk.h: Add MSVC intrinsic __readfsbyte for KeGetCurrentProcessorNumber. Misc fixes.
- Fix various msvc issues in cmd, setupapi, usetup, win32csr, winlogon, msafd, ws2_32 and ext2lib, most notably:
  - cmd & doskey: Don't use fishy gcc extension to allocate variable-sized arrays from the stack. Use the heap instead.
- Disable warning C4733 for mingw_main too (was only done for mingw_wmain previously).
- advapi32: Pass the correct handles to TRACE -- spotted by MSVC.
- Set the specified register in ecx in MSVC versions of Ke386Wrmsr and Ke386Rdmsr instead of reading from/writing to a random MSR. Yay /W4.

svn path=/trunk/; revision=42342
2009-08-02 17:38:27 +00:00
Jeffrey Morlan dcb067a51f - Fix cmd's cgetchar() function so it only returns on a key being pressed, not released.
- Remove ConInDummy function that was called after a line is input. Presumably its purpose was to consume the event of Enter being released, so that that event wouldn't affect the command, but that didn't help when other keys were pressed as well. Anyway, it shouldn't be necessary any more.
- Use correct codepage for reading batch files.

svn path=/trunk/; revision=40311
2009-04-01 03:54:45 +00:00
Jeffrey Morlan 38dec447a2 Replace hard-coded English string constants with translatable resource strings. (Bug 3718)
svn path=/trunk/; revision=40144
2009-03-20 23:16:12 +00:00
Jeffrey Morlan eff51218fb Speed up batch file execution by reading a line at a time instead of a byte at a time.
svn path=/trunk/; revision=39848
2009-03-02 20:00:26 +00:00
Jeffrey Morlan ba3e9218c7 - FileGetString: Only end line on '\n', not on '\r'.
- Various improvements to ExpandAlias

svn path=/trunk/; revision=39817
2009-02-28 18:00:38 +00:00
Jeffrey Morlan 4d6bf5e49a split, splitspace: Allow quotation marks anywhere in an argument, not just the start and end. (Bug 4054)
svn path=/trunk/; revision=39095
2009-01-25 16:39:06 +00:00
Jeffrey Morlan 2429c7df65 Don't treat a slash as the beginning of a new argument for the MOVE command (Bug 4013). Patch by Víctor Martínez Calvo <vicmarcal at hotmail.com>.
svn path=/trunk/; revision=38811
2009-01-17 12:55:46 +00:00
Jeffrey Morlan 07912f2b23 - Implement X>&Y redirections. Hold redirections in a linked list structure, because order matters (>x 2>&1 is not the same as 2>&1 >x). Allow redirection of any handle number from 0 to 9.
- Allow quotes around the redirection file name.
- Batch: Fix buffer overflow bug (incorrect size for bc->BatchFilePath)

svn path=/trunk/; revision=35508
2008-08-21 15:33:59 +00:00
Jeffrey Morlan 198d88a60b - In cmd, add ConOutResPrintf and ConErrResPrintf functions for printf-ing from a resource string; use it to shorten several instances of LoadString+Con*Printf.
- Also change FilePromptYN and FilePromptYNA to take a resource ID. Remove varargs code which nobody used (and didn't actually work anyway)

svn path=/trunk/; revision=34816
2008-07-26 22:49:49 +00:00
Christoph von Wittich 9b8be30ee9 don't overwrite terminating \0 char
some code cleanup

svn path=/trunk/; revision=32083
2008-02-02 10:38:37 +00:00
Daniel Reimer ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Johannes Anderwald 2c932d0e3a - fix warning
svn path=/trunk/; revision=28588
2007-08-26 23:56:05 +00:00
Christoph von Wittich 1ef29d0d83 fix a memory leak
svn path=/trunk/; revision=28085
2007-08-01 22:50:58 +00:00
Thomas Bluemel f5b38b5d3b Remove debug statements I accidently committed
svn path=/trunk/; revision=28071
2007-08-01 13:27:16 +00:00
Thomas Bluemel c8479ce1cb - Detect memory leaks when cmd exits
- Use _tmain

svn path=/trunk/; revision=28070
2007-08-01 12:34:49 +00:00
Thomas Bluemel df91a99233 - Add code to detect buffer overflows and buffer underflows on memory operations. This code is only enabled if _DEBUG is defined.
- Change all calls to malloc, realloc and free to cmd_alloc, cmd_realloc and cmd_free

svn path=/trunk/; revision=28065
2007-08-01 10:17:13 +00:00
Colin Finck ddfbe083e9 Various cmd fixes by Carlo Bramini (carlo DOT bramix AT libero DOT it)
See issue #2232 for more details.

svn path=/trunk/; revision=28022
2007-07-29 19:53:17 +00:00
Eric Kohl e0364c78da Remove outdated email addresses.
svn path=/trunk/; revision=26648
2007-05-05 11:32:25 +00:00
Ged Murphy a5c746a592 move explorer and cmd. Add a few .rbuild files
svn path=/trunk/; revision=21019
2006-02-16 23:23:37 +00:00