* Implemented 'echo.' and 'echoerr.'.
*
* 28-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
- * Remove all hardcode string to En.rc
+ * Remove all hardcode string to En.rc
*/
-#include "precomp.h"
+#include <precomp.h>
#include "resource.h"
INT CommandEcho (LPTSTR cmd, LPTSTR param)
{
TCHAR szMsg[RC_STRING_MAX_SIZE];
+ INT i = 0;
#ifdef _DEBUG
DebugPrintf (_T("CommandEcho '%s' : '%s'\n"), cmd, param);
if (!_tcsncmp (param, _T("/?"), 2))
{
- LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg, RC_STRING_MAX_SIZE);
- ConOutPuts(szMsg);
+ ConOutResPaging(TRUE,STRING_ECHO_HELP4);
return 0;
}
else if (_tcsicmp (param, D_ON) == 0)
bEcho = TRUE;
else if (*param)
+ {
+ while(i < _tcslen(param))
+ {
+ if(param[i] == _T('^'))
+ {
+ memmove(¶m[i],¶m[i + 1], _tcslen(¶m[i]) * sizeof(TCHAR));
+ //skip past the char being escaped
+ i++;
+ }
+ else
+ i++;
+ }
ConOutPuts (param);
+ }
else
{
- LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP4, szMsg, RC_STRING_MAX_SIZE);
+ LoadString(CMD_ModuleHandle, STRING_ECHO_HELP5, szMsg, RC_STRING_MAX_SIZE);
ConOutPrintf(szMsg, bEcho ? D_ON : D_OFF);
}
}
INT CommandEchos (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
#ifdef _DEBUG
DebugPrintf (_T("CommandEchos '%s' : '%s'\n"), cmd, param);
if (!_tcsncmp (param, _T("/?"), 2))
{
- LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP1, szMsg, RC_STRING_MAX_SIZE);
- ConOutPuts(szMsg);
+ ConOutResPuts(STRING_ECHO_HELP1);
return 0;
}
INT CommandEchoerr (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
#ifdef _DEBUG
DebugPrintf (_T("CommandEchoerr '%s' : '%s'\n"), cmd, param);
if (!_tcsncmp (param, _T("/?"), 2))
{
- LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP2, szMsg, RC_STRING_MAX_SIZE);
- ConOutPuts(szMsg);
+ ConOutResPuts(STRING_ECHO_HELP2);
return 0;
}
INT CommandEchoserr (LPTSTR cmd, LPTSTR param)
{
- TCHAR szMsg[RC_STRING_MAX_SIZE];
#ifdef _DEBUG
DebugPrintf (_T("CommandEchoserr '%s' : '%s'\n"), cmd, param);
if (!_tcsncmp (param, _T("/?"), 2))
{
- LoadString(GetModuleHandle(NULL), STRING_ECHO_HELP3, szMsg, RC_STRING_MAX_SIZE);
- ConOutPuts((LPTSTR)szMsg);
+ ConOutResPuts(STRING_ECHO_HELP3);
return 0;
}