diff --git a/reactos/base/shell/cmd/alias.c b/reactos/base/shell/cmd/alias.c index 0c317f82d88..3a209843806 100644 --- a/reactos/base/shell/cmd/alias.c +++ b/reactos/base/shell/cmd/alias.c @@ -139,7 +139,7 @@ VOID ExpandAlias (LPTSTR cmd, INT maxlen) } -INT CommandAlias (LPTSTR cmd, LPTSTR param) +INT CommandAlias (LPTSTR param) { LPTSTR ptr; diff --git a/reactos/base/shell/cmd/attrib.c b/reactos/base/shell/cmd/attrib.c index c207657bb74..2778ba5cc0d 100644 --- a/reactos/base/shell/cmd/attrib.c +++ b/reactos/base/shell/cmd/attrib.c @@ -188,7 +188,7 @@ ChangeAttribute (LPTSTR pszPath, LPTSTR pszFile, DWORD dwMask, } -INT CommandAttrib (LPTSTR cmd, LPTSTR param) +INT CommandAttrib (LPTSTR param) { LPTSTR *arg; INT argc, i; diff --git a/reactos/base/shell/cmd/beep.c b/reactos/base/shell/cmd/beep.c index 75546f62083..efe0473624e 100644 --- a/reactos/base/shell/cmd/beep.c +++ b/reactos/base/shell/cmd/beep.c @@ -29,7 +29,7 @@ #ifdef INCLUDE_CMD_BEEP -INT cmd_beep (LPTSTR cmd, LPTSTR param) +INT cmd_beep (LPTSTR param) { if (_tcsncmp (param, _T("/?"), 2) == 0) { diff --git a/reactos/base/shell/cmd/call.c b/reactos/base/shell/cmd/call.c index 084bfda3ba3..3943c9c45be 100644 --- a/reactos/base/shell/cmd/call.c +++ b/reactos/base/shell/cmd/call.c @@ -40,11 +40,11 @@ * context block. */ -INT cmd_call (LPTSTR cmd, LPTSTR param) +INT cmd_call (LPTSTR param) { LPBATCH_CONTEXT n = NULL; - TRACE ("cmd_call: (\'%s\',\'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_call: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { ConOutResPaging(TRUE,STRING_CALL_HELP); @@ -54,7 +54,7 @@ INT cmd_call (LPTSTR cmd, LPTSTR param) if (*param == _T(':') && (bc)) { bc->lCallPosition = SetFilePointer(bc->hBatchFile, 0, &bc->lCallPositionHigh, FILE_CURRENT); - cmd_goto(_T("goto"), param); + cmd_goto(param); return 0; } diff --git a/reactos/base/shell/cmd/chcp.c b/reactos/base/shell/cmd/chcp.c index 2133f9a9b9a..b834f231b41 100644 --- a/reactos/base/shell/cmd/chcp.c +++ b/reactos/base/shell/cmd/chcp.c @@ -17,7 +17,7 @@ #ifdef INCLUDE_CMD_CHCP -INT CommandChcp (LPTSTR cmd, LPTSTR param) +INT CommandChcp (LPTSTR param) { LPTSTR *arg; INT args; diff --git a/reactos/base/shell/cmd/choice.c b/reactos/base/shell/cmd/choice.c index bf43b8f8e46..6b2c490ea27 100644 --- a/reactos/base/shell/cmd/choice.c +++ b/reactos/base/shell/cmd/choice.c @@ -100,7 +100,7 @@ IsKeyInString (LPTSTR lpString, TCHAR cKey, BOOL bCaseSensitive) INT -CommandChoice (LPTSTR cmd, LPTSTR param) +CommandChoice (LPTSTR param) { LPTSTR lpOptions; TCHAR Options[6]; diff --git a/reactos/base/shell/cmd/cls.c b/reactos/base/shell/cmd/cls.c index cbd5418a209..b821ad2a845 100644 --- a/reactos/base/shell/cmd/cls.c +++ b/reactos/base/shell/cmd/cls.c @@ -30,7 +30,7 @@ #ifdef INCLUDE_CMD_CLS -INT cmd_cls (LPTSTR cmd, LPTSTR param) +INT cmd_cls (LPTSTR param) { CONSOLE_SCREEN_BUFFER_INFO csbi; COORD coPos; diff --git a/reactos/base/shell/cmd/cmd.c b/reactos/base/shell/cmd/cmd.c index d3e6d03d920..0b5da1f566d 100644 --- a/reactos/base/shell/cmd/cmd.c +++ b/reactos/base/shell/cmd/cmd.c @@ -648,7 +648,7 @@ DoCommand (LPTSTR line) if (!_tcscmp (com, cmdptr->name)) { - cmdptr->func (com, rest); + cmdptr->func (rest); break; } @@ -669,11 +669,8 @@ DoCommand (LPTSTR line) { /* OK its one of the specials...*/ - /* Terminate first word properly */ - com[cl] = _T('\0'); - /* Call with new rest */ - cmdptr->func (com, cstart + cl); + cmdptr->func (cstart + cl); break; } } @@ -1541,10 +1538,10 @@ Initialize (int argc, const TCHAR* argv[]) if (!IsExistingFile (_T("\\autoexec.bat"))) { #ifdef INCLUDE_CMD_DATE - cmd_date (_T(""), _T("")); + cmd_date (_T("")); #endif #ifdef INCLUDE_CMD_TIME - cmd_time (_T(""), _T("")); + cmd_time (_T("")); #endif } else diff --git a/reactos/base/shell/cmd/cmd.h b/reactos/base/shell/cmd/cmd.h index 9d709e6247a..e89c3aeb7a8 100644 --- a/reactos/base/shell/cmd/cmd.h +++ b/reactos/base/shell/cmd/cmd.h @@ -68,30 +68,30 @@ extern OSVERSIONINFO osvi; /* Prototypes for ALIAS.C */ VOID ExpandAlias (LPTSTR, INT); -INT CommandAlias (LPTSTR, LPTSTR); +INT CommandAlias (LPTSTR); /* Prototypes for ATTRIB.C */ -INT CommandAttrib (LPTSTR, LPTSTR); +INT CommandAttrib (LPTSTR); /* Prototypes for BEEP.C */ -INT cmd_beep (LPTSTR, LPTSTR); +INT cmd_beep (LPTSTR); /* Prototypes for CALL.C */ -INT cmd_call (LPTSTR, LPTSTR); +INT cmd_call (LPTSTR); /* Prototypes for CHCP.C */ -INT CommandChcp (LPTSTR, LPTSTR); +INT CommandChcp (LPTSTR); /* Prototypes for CHOICE.C */ -INT CommandChoice (LPTSTR, LPTSTR); +INT CommandChoice (LPTSTR); /* Prototypes for CLS.C */ -INT cmd_cls (LPTSTR, LPTSTR); +INT cmd_cls (LPTSTR); /* Prototypes for CMD.C */ @@ -122,7 +122,7 @@ typedef struct tagCOMMAND { LPTSTR name; INT flags; - INT (*func) (LPTSTR, LPTSTR); + INT (*func)(LPTSTR); } COMMAND, *LPCOMMAND; extern COMMAND cmds[]; /* The internal command table */ @@ -135,7 +135,7 @@ LPCTSTR GetParsedEnvVar ( LPCTSTR varName, UINT* varNameLen, BOOL ModeSetA ); /* Prototypes for COLOR.C */ VOID SetScreenColor(WORD wArgColor, BOOL bFill); -INT CommandColor (LPTSTR, LPTSTR); +INT CommandColor (LPTSTR); VOID ConInDummy (VOID); VOID ConInDisable (VOID); @@ -169,39 +169,39 @@ VOID ConErrResPrintf (UINT resID, ...); VOID ConOutResPaging(BOOL NewPage, UINT resID); /* Prototypes for COPY.C */ -INT cmd_copy (LPTSTR, LPTSTR); +INT cmd_copy (LPTSTR); /* Prototypes for DATE.C */ -INT cmd_date (LPTSTR, LPTSTR); +INT cmd_date (LPTSTR); /* Prototypes for DEL.C */ -INT CommandDelete (LPTSTR, LPTSTR); +INT CommandDelete (LPTSTR); /* Prototypes for DELAY.C */ -INT CommandDelay (LPTSTR, LPTSTR); +INT CommandDelay (LPTSTR); /* Prototypes for DIR.C */ -INT CommandDir (LPTSTR, LPTSTR); +INT CommandDir (LPTSTR); /* Prototypes for DIRSTACK.C */ VOID InitDirectoryStack (VOID); VOID DestroyDirectoryStack (VOID); INT GetDirectoryStackDepth (VOID); -INT CommandPushd (LPTSTR, LPTSTR); -INT CommandPopd (LPTSTR, LPTSTR); -INT CommandDirs (LPTSTR, LPTSTR); +INT CommandPushd (LPTSTR); +INT CommandPopd (LPTSTR); +INT CommandDirs (LPTSTR); /* Prototypes for ECHO.C */ -INT CommandEcho (LPTSTR, LPTSTR); -INT CommandEchos (LPTSTR, LPTSTR); -INT CommandEchoerr (LPTSTR, LPTSTR); -INT CommandEchoserr (LPTSTR, LPTSTR); +INT CommandEcho (LPTSTR); +INT CommandEchos (LPTSTR); +INT CommandEchoerr (LPTSTR); +INT CommandEchoserr (LPTSTR); /* Prototypes for ERROR.C */ @@ -235,15 +235,15 @@ VOID CompleteFilename (LPTSTR, BOOL, LPTSTR, UINT); /* Prototypes for FOR.C */ -INT cmd_for (LPTSTR, LPTSTR); +INT cmd_for (LPTSTR); /* Prototypes for FREE.C */ -INT CommandFree (LPTSTR, LPTSTR); +INT CommandFree (LPTSTR); /* Prototypes for GOTO.C */ -INT cmd_goto (LPTSTR, LPTSTR); +INT cmd_goto (LPTSTR); /* Prototypes for HISTORY.C */ @@ -254,23 +254,23 @@ VOID History_move_to_bottom(VOID);/*F3*/ VOID InitHistory(VOID); VOID CleanHistory(VOID); VOID History_del_current_entry(LPTSTR str);/*CTRL-D*/ -INT CommandHistory (LPTSTR cmd, LPTSTR param); +INT CommandHistory (LPTSTR param); #endif /* Prototypes for INTERNAL.C */ VOID InitLastPath (VOID); VOID FreeLastPath (VOID); -INT cmd_chdir (LPTSTR, LPTSTR); -INT cmd_mkdir (LPTSTR, LPTSTR); -INT cmd_rmdir (LPTSTR, LPTSTR); -INT CommandExit (LPTSTR, LPTSTR); -INT CommandRem (LPTSTR, LPTSTR); -INT CommandShowCommands (LPTSTR, LPTSTR); -INT CommandShowCommandsDetail (LPTSTR, LPTSTR); +INT cmd_chdir (LPTSTR); +INT cmd_mkdir (LPTSTR); +INT cmd_rmdir (LPTSTR); +INT CommandExit (LPTSTR); +INT CommandRem (LPTSTR); +INT CommandShowCommands (LPTSTR); +INT CommandShowCommandsDetail (LPTSTR); /* Prototypes for LABEL.C */ -INT cmd_label (LPTSTR, LPTSTR); +INT cmd_label (LPTSTR); /* Prototypes for LOCALE.C */ @@ -292,7 +292,7 @@ extern UINT InputCodePage; extern UINT OutputCodePage; /* Prototypes for MEMORY.C */ -INT CommandMemory (LPTSTR, LPTSTR); +INT CommandMemory (LPTSTR); /* Prototypes for MISC.C */ @@ -322,11 +322,11 @@ INT FilePromptYNA (UINT); /* Prototypes for MOVE.C */ -INT cmd_move (LPTSTR, LPTSTR); +INT cmd_move (LPTSTR); /* Prototypes for MSGBOX.C */ -INT CommandMsgbox (LPTSTR, LPTSTR); +INT CommandMsgbox (LPTSTR); /* Prototypes from PARSER.C */ @@ -346,12 +346,12 @@ VOID FreeCommand(PARSED_COMMAND *Cmd); /* Prototypes from PATH.C */ -INT cmd_path (LPTSTR, LPTSTR); +INT cmd_path (LPTSTR); /* Prototypes from PROMPT.C */ VOID PrintPrompt (VOID); -INT cmd_prompt (LPTSTR, LPTSTR); +INT cmd_prompt (LPTSTR); /* Prototypes for REDIR.C */ @@ -371,24 +371,24 @@ VOID FreeRedirection(REDIRECTION *); /* Prototypes for REN.C */ -INT cmd_rename (LPTSTR, LPTSTR); +INT cmd_rename (LPTSTR); /* Prototypes for REN.C */ -INT cmd_replace (LPTSTR, LPTSTR); +INT cmd_replace (LPTSTR); /* Prototypes for SCREEN.C */ -INT CommandScreen (LPTSTR, LPTSTR); +INT CommandScreen (LPTSTR); /* Prototypes for SET.C */ -INT cmd_set (LPTSTR, LPTSTR); +INT cmd_set (LPTSTR); /* Prototypes for SETLOCAL.C */ -INT cmd_setlocal (LPTSTR, LPTSTR); -INT cmd_endlocal (LPTSTR, LPTSTR); +INT cmd_setlocal (LPTSTR); +INT cmd_endlocal (LPTSTR); /* Prototypes for START.C */ -INT cmd_start (LPTSTR, LPTSTR); +INT cmd_start (LPTSTR); /* Prototypes for STRTOCLR.C */ @@ -396,45 +396,45 @@ BOOL StringToColor (LPWORD, LPTSTR *); /* Prototypes for TIME.C */ -INT cmd_time (LPTSTR, LPTSTR); +INT cmd_time (LPTSTR); /* Prototypes for TIMER.C */ -INT CommandTimer (LPTSTR cmd, LPTSTR param); +INT CommandTimer (LPTSTR param); /* Prototypes for TITLE.C */ -INT cmd_title (LPTSTR, LPTSTR); +INT cmd_title (LPTSTR); /* Prototypes for TYPE.C */ -INT cmd_type (LPTSTR, LPTSTR); +INT cmd_type (LPTSTR); /* Prototypes for VER.C */ VOID ShortVersion (VOID); -INT cmd_ver (LPTSTR, LPTSTR); +INT cmd_ver (LPTSTR); /* Prototypes for VERIFY.C */ -INT cmd_verify (LPTSTR, LPTSTR); +INT cmd_verify (LPTSTR); /* Prototypes for VOL.C */ -INT cmd_vol (LPTSTR, LPTSTR); +INT cmd_vol (LPTSTR); /* Prototypes for WHERE.C */ BOOL SearchForExecutable (LPCTSTR, LPTSTR); /* Prototypes for WINDOW.C */ -INT CommandActivate (LPTSTR, LPTSTR); -INT CommandWindow (LPTSTR, LPTSTR); +INT CommandActivate (LPTSTR); +INT CommandWindow (LPTSTR); /* The MSDOS Batch Commands [MS-DOS 5.0 User's Guide and Reference p359] */ -int cmd_if(TCHAR *, TCHAR *); -int cmd_pause(TCHAR *, TCHAR *); -int cmd_shift(TCHAR *, TCHAR *); +int cmd_if(TCHAR *); +int cmd_pause(TCHAR *); +int cmd_shift(TCHAR *); #endif /* _CMD_H_INCLUDED_ */ diff --git a/reactos/base/shell/cmd/cmdtable.c b/reactos/base/shell/cmd/cmdtable.c index 2143d95fa15..516844fa312 100644 --- a/reactos/base/shell/cmd/cmdtable.c +++ b/reactos/base/shell/cmd/cmdtable.c @@ -93,11 +93,9 @@ COMMAND cmds[] = {_T("dirs"), 0, CommandDirs}, #endif - {_T("echo"), 0, CommandEcho}, - {_T("echo."), CMD_HIDE, CommandEcho}, + {_T("echo"), CMD_SPECIAL, CommandEcho}, {_T("echos"), 0, CommandEchos}, - {_T("echoerr"), 0, CommandEchoerr}, - {_T("echoerr."), CMD_HIDE, CommandEchoerr}, + {_T("echoerr"), CMD_SPECIAL, CommandEchoerr}, {_T("echoserr"), 0, CommandEchoserr}, {_T("endlocal"), 0, cmd_endlocal}, diff --git a/reactos/base/shell/cmd/color.c b/reactos/base/shell/cmd/color.c index 2ee1f44249d..7b6cea9e250 100644 --- a/reactos/base/shell/cmd/color.c +++ b/reactos/base/shell/cmd/color.c @@ -63,7 +63,7 @@ VOID SetScreenColor (WORD wColor, BOOL bNoFill) * * internal dir command */ -INT CommandColor (LPTSTR first, LPTSTR rest) +INT CommandColor (LPTSTR rest) { if (_tcsncmp (rest, _T("/?"), 2) == 0) { diff --git a/reactos/base/shell/cmd/copy.c b/reactos/base/shell/cmd/copy.c index 8526b437179..e01b725d6c2 100644 --- a/reactos/base/shell/cmd/copy.c +++ b/reactos/base/shell/cmd/copy.c @@ -290,7 +290,7 @@ static INT CopyOverwrite (LPTSTR fn) } -INT cmd_copy (LPTSTR cmd, LPTSTR param) +INT cmd_copy (LPTSTR param) { LPTSTR *arg; INT argc, i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1; diff --git a/reactos/base/shell/cmd/date.c b/reactos/base/shell/cmd/date.c index 53a4b5ba9a3..ef089447b83 100644 --- a/reactos/base/shell/cmd/date.c +++ b/reactos/base/shell/cmd/date.c @@ -176,7 +176,7 @@ ParseDate (LPTSTR s) } -INT cmd_date (LPTSTR cmd, LPTSTR param) +INT cmd_date (LPTSTR param) { LPTSTR *arg; INT argc; diff --git a/reactos/base/shell/cmd/del.c b/reactos/base/shell/cmd/del.c index 3785fc0956e..45d880f9fe3 100644 --- a/reactos/base/shell/cmd/del.c +++ b/reactos/base/shell/cmd/del.c @@ -354,7 +354,7 @@ ProcessDirectory(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags) -INT CommandDelete (LPTSTR cmd, LPTSTR param) +INT CommandDelete (LPTSTR param) { /*cmd is the command that was given, in this case it will always be "del" or "delete" param is whatever is given after the command*/ diff --git a/reactos/base/shell/cmd/delay.c b/reactos/base/shell/cmd/delay.c index eebbaf01cfb..2f80958a9c1 100644 --- a/reactos/base/shell/cmd/delay.c +++ b/reactos/base/shell/cmd/delay.c @@ -14,7 +14,7 @@ #ifdef INCLUDE_CMD_DELAY -INT CommandDelay (LPTSTR cmd, LPTSTR param) +INT CommandDelay (LPTSTR param) { DWORD val; DWORD mul=1000; diff --git a/reactos/base/shell/cmd/dir.c b/reactos/base/shell/cmd/dir.c index 5968fe4df7e..9c3314e2601 100644 --- a/reactos/base/shell/cmd/dir.c +++ b/reactos/base/shell/cmd/dir.c @@ -1789,7 +1789,7 @@ ULARGE_INTEGER u64Temp; /* A temporary counter */ * internal dir command */ INT -CommandDir(LPTSTR first, LPTSTR rest) +CommandDir(LPTSTR rest) { TCHAR dircmd[256]; /* A variable to store the DIRCMD enviroment variable */ TCHAR path[MAX_PATH]; diff --git a/reactos/base/shell/cmd/dirstack.c b/reactos/base/shell/cmd/dirstack.c index 8c1e0189b2c..2aff845cabc 100644 --- a/reactos/base/shell/cmd/dirstack.c +++ b/reactos/base/shell/cmd/dirstack.c @@ -140,7 +140,7 @@ INT GetDirectoryStackDepth (VOID) /* * pushd command */ -INT CommandPushd (LPTSTR first, LPTSTR rest) +INT CommandPushd (LPTSTR rest) { TCHAR curPath[MAX_PATH]; TCHAR newPath[MAX_PATH]; @@ -174,7 +174,7 @@ INT CommandPushd (LPTSTR first, LPTSTR rest) /* * popd command */ -INT CommandPopd (LPTSTR first, LPTSTR rest) +INT CommandPopd (LPTSTR rest) { TCHAR szPath[MAX_PATH]; @@ -201,7 +201,7 @@ INT CommandPopd (LPTSTR first, LPTSTR rest) /* * dirs command */ -INT CommandDirs (LPTSTR first, LPTSTR rest) +INT CommandDirs (LPTSTR rest) { LPDIRENTRY lpDir; diff --git a/reactos/base/shell/cmd/echo.c b/reactos/base/shell/cmd/echo.c index 0706be4d70d..e6ea2d11cfa 100644 --- a/reactos/base/shell/cmd/echo.c +++ b/reactos/base/shell/cmd/echo.c @@ -29,24 +29,11 @@ #include -INT CommandEcho (LPTSTR cmd, LPTSTR param) +INT CommandEcho (LPTSTR param) { LPTSTR p1, p2; - TRACE ("CommandEcho '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); - - if (_tcsicmp (cmd, _T("echo.")) == 0) - { - if (param[0] == 0) - ConOutChar (_T('\n')); - else - ConOutPuts (param); - } - else - { - /* skip the first delimiter */ - if (_istspace(*param)) - param++; + TRACE ("CommandEcho: '%s'\n", debugstr_aw(param)); /* skip all spaces for the check of '/?', 'ON' and 'OFF' */ p1 = param; @@ -83,22 +70,22 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param) } if (*p1 != _T('\0')) { - ConOutPuts (param); + /* skip the first character */ + ConOutPuts(param + 1); } else { ConOutResPrintf(STRING_ECHO_HELP5, bEcho ? D_ON : D_OFF); } - } return 0; } -INT CommandEchos (LPTSTR cmd, LPTSTR param) +INT CommandEchos (LPTSTR param) { - TRACE ("CommandEchos '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchos: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -113,10 +100,10 @@ INT CommandEchos (LPTSTR cmd, LPTSTR param) } -INT CommandEchoerr (LPTSTR cmd, LPTSTR param) +INT CommandEchoerr (LPTSTR param) { - TRACE ("CommandEchoerr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchoerr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { @@ -124,26 +111,16 @@ INT CommandEchoerr (LPTSTR cmd, LPTSTR param) return 0; } - if (_tcsicmp (cmd, _T("echoerr.")) == 0) - { - if (param[0] == 0) - ConErrChar (_T('\n')); - else - ConErrPuts (param); - } - else if (*param) - { - ConErrPuts (param); - } + ConErrPuts (param); return 0; } -INT CommandEchoserr (LPTSTR cmd, LPTSTR param) +INT CommandEchoserr (LPTSTR param) { - TRACE ("CommandEchoserr '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("CommandEchoserr: '%s'\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/for.c b/reactos/base/shell/cmd/for.c index ff586c912dc..e60ec383157 100644 --- a/reactos/base/shell/cmd/for.c +++ b/reactos/base/shell/cmd/for.c @@ -47,14 +47,14 @@ * per list element. */ -INT cmd_for (LPTSTR cmd, LPTSTR param) +INT cmd_for (LPTSTR param) { LPBATCH_CONTEXT lpNew; LPTSTR pp; TCHAR var; TCHAR szMsg[RC_STRING_MAX_SIZE]; - TRACE ("cmd_for (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_for (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/free.c b/reactos/base/shell/cmd/free.c index 14002e1444e..c669d8c7cc4 100644 --- a/reactos/base/shell/cmd/free.c +++ b/reactos/base/shell/cmd/free.c @@ -84,7 +84,7 @@ PrintDiskInfo (LPTSTR szDisk) } -INT CommandFree (LPTSTR cmd, LPTSTR param) +INT CommandFree (LPTSTR param) { LPTSTR szParam; TCHAR szDefPath[MAX_PATH]; diff --git a/reactos/base/shell/cmd/goto.c b/reactos/base/shell/cmd/goto.c index 216a9997ef7..b6a7bfc70bd 100644 --- a/reactos/base/shell/cmd/goto.c +++ b/reactos/base/shell/cmd/goto.c @@ -36,13 +36,13 @@ * */ -INT cmd_goto (LPTSTR cmd, LPTSTR param) +INT cmd_goto (LPTSTR param) { TCHAR szMsg[RC_STRING_MAX_SIZE]; LPTSTR tmp, tmp2; LONG lNewPosHigh = 0; - TRACE ("cmd_goto (\'%s\', \'%s\'\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_goto (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/history.c b/reactos/base/shell/cmd/history.c index 02f22169761..5a85527b225 100644 --- a/reactos/base/shell/cmd/history.c +++ b/reactos/base/shell/cmd/history.c @@ -74,7 +74,7 @@ VOID set_size(INT new_size); -INT CommandHistory (LPTSTR cmd, LPTSTR param) +INT CommandHistory (LPTSTR param) { LPTSTR tmp; INT tmp_int; diff --git a/reactos/base/shell/cmd/if.c b/reactos/base/shell/cmd/if.c index 153c7c7d127..061173bedd3 100644 --- a/reactos/base/shell/cmd/if.c +++ b/reactos/base/shell/cmd/if.c @@ -36,12 +36,12 @@ #define X_EXEC 1 #define X_EMPTY 0x80 -INT cmd_if (LPTSTR cmd, LPTSTR param) +INT cmd_if (LPTSTR param) { INT x_flag = 0; /* when set cause 'then' clause to be executed */ LPTSTR pp; - TRACE ("cmd_if: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_if: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/internal.c b/reactos/base/shell/cmd/internal.c index b079e3e6502..afc553cb2a1 100644 --- a/reactos/base/shell/cmd/internal.c +++ b/reactos/base/shell/cmd/internal.c @@ -267,7 +267,7 @@ BOOL SetRootPath(TCHAR *InPath) * CD / CHDIR * */ -INT cmd_chdir (LPTSTR cmd, LPTSTR param) +INT cmd_chdir (LPTSTR param) { WIN32_FIND_DATA f; @@ -455,10 +455,9 @@ MakeFullPath(TCHAR * DirPath) * MD / MKDIR * */ -INT cmd_mkdir (LPTSTR cmd, LPTSTR param) +INT cmd_mkdir (LPTSTR param) { LPTSTR dir; /* pointer to the directory to change to */ - LPTSTR place; /* used to search for the \ when no space is used */ LPTSTR *p = NULL; INT argc; nErrorLevel = 0; @@ -469,28 +468,6 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param) } - /* check if there is no space between the command and the path */ - if (param[0] == _T('\0')) - { - /* search for the \ or . so that both short & long names will work */ - for (place = cmd; *place; place++) - if (*place == _T('.') || *place == _T('\\')) - break; - - if (*place) - { - argc = 0; - if (add_entry(&argc, &p, place)) - dir = place; - else - dir = NULL; - } - else - /* signal that there are no parameters */ - dir = NULL; - } - else - { p = split (param, &argc, FALSE); if (argc > 1) { @@ -501,7 +478,6 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param) } else dir = p[0]; - } if (!dir) { @@ -573,7 +549,7 @@ BOOL DeleteFolder(LPTSTR FileName) } return RemoveDirectory(FileName); } -INT cmd_rmdir (LPTSTR cmd, LPTSTR param) +INT cmd_rmdir (LPTSTR param) { TCHAR dir[MAX_PATH]; /* pointer to the directory to change to */ TCHAR ch; @@ -707,7 +683,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param) * set the exitflag to true * */ -INT CommandExit (LPTSTR cmd, LPTSTR param) +INT CommandExit (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { @@ -741,7 +717,7 @@ INT CommandExit (LPTSTR cmd, LPTSTR param) * does nothing * */ -INT CommandRem (LPTSTR cmd, LPTSTR param) +INT CommandRem (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { @@ -753,13 +729,13 @@ INT CommandRem (LPTSTR cmd, LPTSTR param) #endif /* INCLUDE_CMD_REM */ -INT CommandShowCommands (LPTSTR cmd, LPTSTR param) +INT CommandShowCommands (LPTSTR param) { PrintCommandList (); return 0; } -INT CommandShowCommandsDetail (LPTSTR cmd, LPTSTR param) +INT CommandShowCommandsDetail (LPTSTR param) { /* If a param was send, display help of correspondent command */ if (_tcslen(param)) diff --git a/reactos/base/shell/cmd/label.c b/reactos/base/shell/cmd/label.c index 745ff900dcd..bd9eda38761 100644 --- a/reactos/base/shell/cmd/label.c +++ b/reactos/base/shell/cmd/label.c @@ -22,7 +22,7 @@ #ifdef INCLUDE_CMD_LABEL -INT cmd_label (LPTSTR cmd, LPTSTR param) +INT cmd_label (LPTSTR param) { TCHAR szRootPath[] = _T("A:\\"); TCHAR szLabel[80]; diff --git a/reactos/base/shell/cmd/memory.c b/reactos/base/shell/cmd/memory.c index e838f655b17..1a0a5664a2d 100644 --- a/reactos/base/shell/cmd/memory.c +++ b/reactos/base/shell/cmd/memory.c @@ -32,7 +32,7 @@ ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator) } -INT CommandMemory (LPTSTR cmd, LPTSTR param) +INT CommandMemory (LPTSTR param) { MEMORYSTATUS ms; TCHAR szMemoryLoad[20]; diff --git a/reactos/base/shell/cmd/move.c b/reactos/base/shell/cmd/move.c index dc4ec4fc684..015740514bc 100644 --- a/reactos/base/shell/cmd/move.c +++ b/reactos/base/shell/cmd/move.c @@ -83,7 +83,7 @@ void GetDirectory (LPTSTR wholepath, LPTSTR directory, BOOL CheckExisting) } -INT cmd_move (LPTSTR cmd, LPTSTR param) +INT cmd_move (LPTSTR param) { LPTSTR *arg; INT argc, i, nFiles; diff --git a/reactos/base/shell/cmd/msgbox.c b/reactos/base/shell/cmd/msgbox.c index 3e92f0ea2b5..31658e11683 100644 --- a/reactos/base/shell/cmd/msgbox.c +++ b/reactos/base/shell/cmd/msgbox.c @@ -22,7 +22,7 @@ #define _SYNTAX_CHECK -INT CommandMsgbox (LPTSTR cmd, LPTSTR param) +INT CommandMsgbox (LPTSTR param) { //used to parse command line diff --git a/reactos/base/shell/cmd/path.c b/reactos/base/shell/cmd/path.c index fc112d17b63..68a5c920351 100644 --- a/reactos/base/shell/cmd/path.c +++ b/reactos/base/shell/cmd/path.c @@ -33,7 +33,7 @@ #define ENV_BUFFER_SIZE 1024 -INT cmd_path (LPTSTR cmd, LPTSTR param) +INT cmd_path (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) diff --git a/reactos/base/shell/cmd/pause.c b/reactos/base/shell/cmd/pause.c index 6c77b258a44..fc56c1399d8 100644 --- a/reactos/base/shell/cmd/pause.c +++ b/reactos/base/shell/cmd/pause.c @@ -34,10 +34,10 @@ * Remove all hardcode string to En.rc */ -INT cmd_pause (LPTSTR cmd, LPTSTR param) +INT cmd_pause (LPTSTR param) { - TRACE ("cmd_pause: \'%s\' : \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_pause: \'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/prompt.c b/reactos/base/shell/cmd/prompt.c index 399446c0c00..81e9d17764f 100644 --- a/reactos/base/shell/cmd/prompt.c +++ b/reactos/base/shell/cmd/prompt.c @@ -190,7 +190,7 @@ VOID PrintPrompt(VOID) #ifdef INCLUDE_CMD_PROMPT -INT cmd_prompt (LPTSTR cmd, LPTSTR param) +INT cmd_prompt (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/ren.c b/reactos/base/shell/cmd/ren.c index fb1267c533e..ad1e1de7977 100644 --- a/reactos/base/shell/cmd/ren.c +++ b/reactos/base/shell/cmd/ren.c @@ -40,7 +40,7 @@ enum * file rename internal command. * */ -INT cmd_rename (LPTSTR cmd, LPTSTR param) +INT cmd_rename (LPTSTR param) { LPTSTR *arg = NULL; INT args = 0; diff --git a/reactos/base/shell/cmd/replace.c b/reactos/base/shell/cmd/replace.c index 3c8e6c2c72a..dd3c168ae0d 100644 --- a/reactos/base/shell/cmd/replace.c +++ b/reactos/base/shell/cmd/replace.c @@ -358,7 +358,7 @@ INT recFindSubDirs(DWORD dwFlags, return filesReplaced; } -INT cmd_replace (LPTSTR cmd, LPTSTR param) +INT cmd_replace (LPTSTR param) { LPTSTR *arg; INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1; diff --git a/reactos/base/shell/cmd/screen.c b/reactos/base/shell/cmd/screen.c index d3c08990f04..26e66a19f54 100644 --- a/reactos/base/shell/cmd/screen.c +++ b/reactos/base/shell/cmd/screen.c @@ -16,7 +16,7 @@ #ifdef INCLUDE_CMD_SCREEN -INT CommandScreen (LPTSTR cmd, LPTSTR param) +INT CommandScreen (LPTSTR param) { SHORT x,y; BOOL bSkipText = FALSE; diff --git a/reactos/base/shell/cmd/set.c b/reactos/base/shell/cmd/set.c index dda4d945fe0..7c60fe17a3c 100644 --- a/reactos/base/shell/cmd/set.c +++ b/reactos/base/shell/cmd/set.c @@ -51,7 +51,7 @@ skip_ws ( LPCTSTR p ) return p + _tcsspn ( p, _T(" \t") ); } -INT cmd_set (LPTSTR cmd, LPTSTR param) +INT cmd_set (LPTSTR param) { LPTSTR p; diff --git a/reactos/base/shell/cmd/setlocal.c b/reactos/base/shell/cmd/setlocal.c index d939d0c53ed..4bf5022f47c 100644 --- a/reactos/base/shell/cmd/setlocal.c +++ b/reactos/base/shell/cmd/setlocal.c @@ -14,13 +14,13 @@ /* our current default is delayedexpansion */ -INT cmd_setlocal (LPTSTR cmd, LPTSTR param) +INT cmd_setlocal (LPTSTR param) { return 0; } /* endlocal doesn't take any params */ -INT cmd_endlocal (LPTSTR cmd, LPTSTR param) +INT cmd_endlocal (LPTSTR param) { return 0; } diff --git a/reactos/base/shell/cmd/shift.c b/reactos/base/shell/cmd/shift.c index 142a8fc53d3..8e97452546f 100644 --- a/reactos/base/shell/cmd/shift.c +++ b/reactos/base/shell/cmd/shift.c @@ -36,10 +36,10 @@ * */ -INT cmd_shift (LPTSTR cmd, LPTSTR param) +INT cmd_shift (LPTSTR param) { - TRACE ("cmd_shift: (\'%s\', \'%s\')\n", debugstr_aw(cmd), debugstr_aw(param)); + TRACE ("cmd_shift: (\'%s\')\n", debugstr_aw(param)); if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/start.c b/reactos/base/shell/cmd/start.c index 1c9d5877e30..dc680352c7c 100644 --- a/reactos/base/shell/cmd/start.c +++ b/reactos/base/shell/cmd/start.c @@ -34,7 +34,7 @@ static TCHAR *GetParameter(TCHAR **pPointer) return start - 1; } -INT cmd_start (LPTSTR First, LPTSTR Rest) +INT cmd_start (LPTSTR Rest) { TCHAR szFullName[CMDLINE_LENGTH]; TCHAR rest[CMDLINE_LENGTH]; diff --git a/reactos/base/shell/cmd/time.c b/reactos/base/shell/cmd/time.c index b62f6417c97..00cbd7cf657 100644 --- a/reactos/base/shell/cmd/time.c +++ b/reactos/base/shell/cmd/time.c @@ -129,7 +129,7 @@ static BOOL ParseTime (LPTSTR s) } -INT cmd_time (LPTSTR cmd, LPTSTR param) +INT cmd_time (LPTSTR param) { LPTSTR *arg; INT argc; diff --git a/reactos/base/shell/cmd/timer.c b/reactos/base/shell/cmd/timer.c index db9c5096eaa..f189509d353 100644 --- a/reactos/base/shell/cmd/timer.c +++ b/reactos/base/shell/cmd/timer.c @@ -60,7 +60,7 @@ PrintElapsedTime (DWORD time,INT format) } -INT CommandTimer (LPTSTR cmd, LPTSTR param) +INT CommandTimer (LPTSTR param) { // all timers are kept static DWORD clksT[10]; diff --git a/reactos/base/shell/cmd/title.c b/reactos/base/shell/cmd/title.c index 7f56fd63485..5e1199fdeb0 100644 --- a/reactos/base/shell/cmd/title.c +++ b/reactos/base/shell/cmd/title.c @@ -14,7 +14,7 @@ #ifdef INCLUDE_CMD_TITLE -INT cmd_title (LPTSTR cmd, LPTSTR param) +INT cmd_title (LPTSTR param) { /* Do nothing if no args */ diff --git a/reactos/base/shell/cmd/type.c b/reactos/base/shell/cmd/type.c index 05ccc7b26f5..d94ca710b97 100644 --- a/reactos/base/shell/cmd/type.c +++ b/reactos/base/shell/cmd/type.c @@ -31,7 +31,7 @@ #ifdef INCLUDE_CMD_TYPE -INT cmd_type (LPTSTR cmd, LPTSTR param) +INT cmd_type (LPTSTR param) { TCHAR buff[256]; HANDLE hFile, hConsoleOut; diff --git a/reactos/base/shell/cmd/ver.c b/reactos/base/shell/cmd/ver.c index 74f3c63b280..55cbd25da8e 100644 --- a/reactos/base/shell/cmd/ver.c +++ b/reactos/base/shell/cmd/ver.c @@ -57,7 +57,7 @@ VOID ShortVersion (VOID) * * */ -INT cmd_ver (LPTSTR cmd, LPTSTR param) +INT cmd_ver (LPTSTR param) { INT i; diff --git a/reactos/base/shell/cmd/verify.c b/reactos/base/shell/cmd/verify.c index af965cbdeab..dba702ea6e1 100644 --- a/reactos/base/shell/cmd/verify.c +++ b/reactos/base/shell/cmd/verify.c @@ -27,7 +27,7 @@ static BOOL bVerify = FALSE; -INT cmd_verify (LPTSTR cmd, LPTSTR param) +INT cmd_verify (LPTSTR param) { if (!_tcsncmp (param, _T("/?"), 2)) { diff --git a/reactos/base/shell/cmd/vol.c b/reactos/base/shell/cmd/vol.c index 7c1b23731ea..0402df8a43a 100644 --- a/reactos/base/shell/cmd/vol.c +++ b/reactos/base/shell/cmd/vol.c @@ -61,7 +61,7 @@ PrintVolumeHeader (LPTSTR pszRootPath) } -INT cmd_vol (LPTSTR cmd, LPTSTR param) +INT cmd_vol (LPTSTR param) { TCHAR szRootPath[] = _T("A:\\"); TCHAR szPath[MAX_PATH]; diff --git a/reactos/base/shell/cmd/window.c b/reactos/base/shell/cmd/window.c index a507504de8c..1fa23da30bc 100644 --- a/reactos/base/shell/cmd/window.c +++ b/reactos/base/shell/cmd/window.c @@ -173,7 +173,7 @@ static INT ServiceActivate (LPTSTR param, HWND hWnd) -INT CommandWindow (LPTSTR cmd, LPTSTR param) +INT CommandWindow (LPTSTR param) { HWND hwnd; @@ -189,7 +189,7 @@ INT CommandWindow (LPTSTR cmd, LPTSTR param) } -INT CommandActivate (LPTSTR cmd, LPTSTR param) +INT CommandActivate (LPTSTR param) { HWND hwnd; LPTSTR *arg;