mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 23:06:00 +00:00
[CMD]
And finally... ... ... fix whitespace, part 6/6 !!!! (convert tabs into 4-space indent). Really, CMD is, together with win32k, the worst indented project I've ever seen. You have lots of non-sensical extra newlines put in the middle of the code, weird indentation made by a mix of tabs / spaces which take either 4 or 8 or even (!!) 2 spaces per indentation level; sometimes some guy mixed his space key with his tab key to add a space between a word and another one; a mix of some sh*tty code styles (K&R and personal ones), many many times no space between a logical keyword and the operand on which it applies, etc... etc... I tried to put some sense in it, but I may have forgotten some insidious tabs somewhere... svn path=/trunk/; revision=59389
This commit is contained in:
parent
8e04e7f45a
commit
18857125d2
1 changed files with 1261 additions and 1266 deletions
|
@ -309,7 +309,6 @@ HANDLE RunFile(DWORD flags, LPTSTR filename, LPTSTR params,
|
||||||
* First - first word on command line
|
* First - first word on command line
|
||||||
* Rest - rest of command line
|
* Rest - rest of command line
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static INT
|
static INT
|
||||||
Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
|
Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
|
||||||
{
|
{
|
||||||
|
@ -489,7 +488,6 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
|
||||||
* first - first word on command line
|
* first - first word on command line
|
||||||
* rest - rest of command line
|
* rest - rest of command line
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INT
|
INT
|
||||||
DoCommand(LPTSTR first, LPTSTR rest, PARSED_COMMAND *Cmd)
|
DoCommand(LPTSTR first, LPTSTR rest, PARSED_COMMAND *Cmd)
|
||||||
{
|
{
|
||||||
|
@ -560,7 +558,6 @@ DoCommand(LPTSTR first, LPTSTR rest, PARSED_COMMAND *Cmd)
|
||||||
* process the command line and execute the appropriate functions
|
* process the command line and execute the appropriate functions
|
||||||
* full input/output redirection and piping are supported
|
* full input/output redirection and piping are supported
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INT ParseCommandLine (LPTSTR cmd)
|
INT ParseCommandLine (LPTSTR cmd)
|
||||||
{
|
{
|
||||||
INT Ret = 0;
|
INT Ret = 0;
|
||||||
|
@ -1292,8 +1289,10 @@ static LPTSTR FindForVar(TCHAR Var, BOOL *IsParam0)
|
||||||
FOR_CONTEXT *Ctx;
|
FOR_CONTEXT *Ctx;
|
||||||
*IsParam0 = FALSE;
|
*IsParam0 = FALSE;
|
||||||
for (Ctx = fc; Ctx != NULL; Ctx = Ctx->prev)
|
for (Ctx = fc; Ctx != NULL; Ctx = Ctx->prev)
|
||||||
|
{
|
||||||
if ((UINT)(Var - Ctx->firstvar) < Ctx->varcount)
|
if ((UINT)(Var - Ctx->firstvar) < Ctx->varcount)
|
||||||
return Ctx->values[Var - Ctx->firstvar];
|
return Ctx->values[Var - Ctx->firstvar];
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1429,7 +1428,6 @@ ProcessInput()
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI BreakHandler (DWORD dwCtrlType)
|
BOOL WINAPI BreakHandler (DWORD dwCtrlType)
|
||||||
{
|
{
|
||||||
|
|
||||||
DWORD dwWritten;
|
DWORD dwWritten;
|
||||||
INPUT_RECORD rec;
|
INPUT_RECORD rec;
|
||||||
static BOOL SelfGenerated = FALSE;
|
static BOOL SelfGenerated = FALSE;
|
||||||
|
@ -1468,8 +1466,7 @@ BOOL WINAPI BreakHandler (DWORD dwCtrlType)
|
||||||
rec.Event.KeyEvent.uChar.UnicodeChar = _T('C');
|
rec.Event.KeyEvent.uChar.UnicodeChar = _T('C');
|
||||||
rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED;
|
rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED;
|
||||||
|
|
||||||
WriteConsoleInput(
|
WriteConsoleInput(hIn,
|
||||||
hIn,
|
|
||||||
&rec,
|
&rec,
|
||||||
1,
|
1,
|
||||||
&dwWritten);
|
&dwWritten);
|
||||||
|
@ -1479,7 +1476,6 @@ BOOL WINAPI BreakHandler (DWORD dwCtrlType)
|
||||||
|
|
||||||
//ConOutPrintf(_T("^C"));
|
//ConOutPrintf(_T("^C"));
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1541,7 +1537,7 @@ ExecuteAutoRunFile(HKEY hkeyRoot)
|
||||||
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
||||||
0,
|
0,
|
||||||
KEY_READ,
|
KEY_READ,
|
||||||
&hkey ) == ERROR_SUCCESS)
|
&hkey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
if(RegQueryValueEx(hkey,
|
if(RegQueryValueEx(hkey,
|
||||||
_T("AutoRun"),
|
_T("AutoRun"),
|
||||||
|
@ -1674,7 +1670,6 @@ Initialize()
|
||||||
/* add ctrl break handler */
|
/* add ctrl break handler */
|
||||||
AddBreakHandler ();
|
AddBreakHandler ();
|
||||||
|
|
||||||
|
|
||||||
SetConsoleMode (hIn, ENABLE_PROCESSED_INPUT);
|
SetConsoleMode (hIn, ENABLE_PROCESSED_INPUT);
|
||||||
|
|
||||||
cmdLine = GetCommandLine();
|
cmdLine = GetCommandLine();
|
||||||
|
@ -1807,8 +1802,8 @@ static VOID Cleanup()
|
||||||
|
|
||||||
/* remove ctrl break handler */
|
/* remove ctrl break handler */
|
||||||
RemoveBreakHandler ();
|
RemoveBreakHandler ();
|
||||||
SetConsoleMode( GetStdHandle( STD_INPUT_HANDLE ),
|
SetConsoleMode(GetStdHandle( STD_INPUT_HANDLE ),
|
||||||
ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT );
|
ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT);
|
||||||
DeleteCriticalSection(&ChildProcessRunningLock);
|
DeleteCriticalSection(&ChildProcessRunningLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue