revers brandon change to prompt.c they are incorrect. Add a check if
prompt env are set or not. if it is not set cmd set the prompt value. in
cmd.c brandon forget that.
Modified: trunk/reactos/subsys/system/cmd/cmd.c
Modified: trunk/reactos/subsys/system/cmd/prompt.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-09-03 01:34:40 UTC
(rev 17613)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-09-03 09:46:46 UTC
(rev 17614)
@@ -1311,6 +1311,7 @@
TCHAR commandline[CMDLINE_LENGTH];
TCHAR ModuleName[_MAX_PATH + 1];
INT i;
+ TCHAR lpBuffer[2];
//INT len;
//TCHAR *ptr, *cmdLine;
@@ -1358,7 +1359,12 @@
hOut = GetStdHandle (STD_OUTPUT_HANDLE);
hIn = GetStdHandle (STD_INPUT_HANDLE);
- SetEnvironmentVariable (_T("PROMPT"), _T("$P$G"));
+ /* Set EnvironmentVariable PROMPT if it does not exists any env
value.
+ for you can change the EnvirommentVariable for prompt before
cmd start
+ this patch are not 100% right, if it does not exists a PROMPT
value cmd should use
+ $P$G as defualt not set EnvirommentVariable PROMPT to $P$G if
it does not exists */
+ if (GetEnvironmentVariable(_T("PROMPT"),lpBuffer, 2 *
sizeof(TCHAR)) == 0)
+ SetEnvironmentVariable (_T("PROMPT"), _T("$P$G"));
if (argc >= 2 && !_tcsncmp (argv[1], _T("/?"), 2))
_____
Modified: trunk/reactos/subsys/system/cmd/prompt.c
--- trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 01:34:40 UTC
(rev 17613)
+++ trunk/reactos/subsys/system/cmd/prompt.c 2005-09-03 09:46:46 UTC
(rev 17614)
@@ -192,8 +192,7 @@
#ifdef INCLUDE_CMD_PROMPT
INT cmd_prompt (LPTSTR cmd, LPTSTR param)
-{
- TCHAR szParam[512];
+{
if (!_tcsncmp (param, _T("/?"), 2))
{
ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
@@ -204,15 +203,14 @@
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"), szParam))
- return 1;
-
+ if (param[0] != _T('\0'))
+ {
+ if (!SetEnvironmentVariable (_T("PROMPT"), param))
+ return 1;
+ }
+
return 0;
}
#endif
Show replies by date