break;
case _T('T'):
- {
- TCHAR szTime[32];
- GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,szTime, sizeof(szTime));
- ConOutPrintf("%s",szTime);
+ {
+ SYSTEMTIME t;
+ GetSystemTime(&t);
+ ConOutPrintf(_T("%02d%c%02d%c%02d%c%02d\n"),t.wHour, cTimeSeparator,t.wMinute , cTimeSeparator,
+ t.wSecond , cDecimalSeparator, t.wMilliseconds );
}
break;
INT cmd_prompt (LPTSTR cmd, LPTSTR param)
{
-
+ TCHAR szParam[512];
if (!_tcsncmp (param, _T("/?"), 2))
{
ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
ConOutResPaging(FALSE,STRING_PROMPT_HELP3);
return 0;
}
+ if (param[0] != _T('\0'))
+ _tcscpy(szParam,param);
+ else
+ _tcscpy(szParam,_T("$P$G"));
/* set PROMPT environment variable */
- if (!SetEnvironmentVariable (_T("PROMPT"), param))
+ if (!SetEnvironmentVariable (_T("PROMPT"), szParam))
return 1;
return 0;