Correctly assign %propmt%.
[reactos.git] / reactos / subsys / system / cmd / prompt.c
index 9414754..34cad00 100644 (file)
@@ -138,10 +138,11 @@ VOID PrintPrompt(VOID)
                                        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;
           
@@ -192,7 +193,7 @@ VOID PrintPrompt(VOID)
 
 INT cmd_prompt (LPTSTR cmd, LPTSTR param)
 {
-
+       TCHAR szParam[512];
        if (!_tcsncmp (param, _T("/?"), 2))
        {
                ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
@@ -203,9 +204,13 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param)
                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;