reactos/reactos/base/shell/cmd/screen.c
Jeffrey Morlan c49ed3a82c Remove the "LPTSTR cmd" argument to internal commands; there's no need for a command to be told its own name. It was only used in two places:
- a hack in cmd_mkdir that was already obsolete a decade ago
- to distinguish "echo" from "echo.", but that is the wrong way to implement this anyway. There's nothing particularly special about the period, "echo" is just one of those commands that is lenient about where its parameters begin, and when it echos a line, the first character (usually a space, but in the case of "echo." a period) is skipped.

svn path=/trunk/; revision=35647
2008-08-25 23:22:03 +00:00

104 lines
1.3 KiB
C

/*
* SCREEN.C - screen internal command.
*
* clone from 4nt msgbox command
*
* 30 Aug 1999
* started - Paolo Pantaleo <paolopan@freemail.it>
*
* 30-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
* Remove all hardcode string to En.rc
*
*/
#include <precomp.h>
#ifdef INCLUDE_CMD_SCREEN
INT CommandScreen (LPTSTR param)
{
SHORT x,y;
BOOL bSkipText = FALSE;
if (_tcsncmp (param, _T("/?"), 2) == 0)
{
ConOutResPaging(TRUE,STRING_SCREEN_HELP);
return 0;
}
nErrorLevel = 0;
//get row
while(_istspace(*param))
param++;
if(!(*param))
{
error_req_param_missing ();
return 1;
}
y = _ttoi(param);
if (y<0 || y>(maxy-1))
{
ConOutResPuts(STRING_SCREEN_ROW);
return 1;
}
//get col
if(!(param = _tcschr(param,_T(' '))))
{
error_req_param_missing ();
return 1;
}
while(_istspace(*param))
param++;
if(!(*param))
{
error_req_param_missing ();
return 1;
}
x = _ttoi(param);
if (x<0 || x>(maxx-1))
{
ConErrResPuts(STRING_SCREEN_COL);
return 1;
}
//get text
if(!(param = _tcschr(param,_T(' '))))
{
bSkipText = TRUE;
}
else
{
while(_istspace(*param))
param++;
if(!(*param))
{
bSkipText = TRUE;
}
}
bIgnoreEcho = TRUE;
if(bSkipText)
x=0;
SetCursorXY(x,y);
if(!(bSkipText))
ConOutPuts(param);
return 0;
}
#endif /* INCLUDE_CMD_SCREEN */