Correctly assign %propmt%.
cmd.c = give %prompt% default value of $P$G
prompt.c = when param are null, assign %prompt% to $P$G
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:19:25 UTC (rev 17612)
+++ trunk/reactos/subsys/system/cmd/cmd.c	2005-09-03 01:34:40 UTC (rev 17613)
@@ -1358,7 +1358,9 @@
 	hOut = GetStdHandle (STD_OUTPUT_HANDLE);
 	hIn  = GetStdHandle (STD_INPUT_HANDLE);
 
+	SetEnvironmentVariable (_T("PROMPT"), _T("$P$G"));
 
+
 	if (argc >= 2 && !_tcsncmp (argv[1], _T("/?"), 2))
 	{
 		ConOutResPaging(TRUE,STRING_CMD_HELP8);

Modified: trunk/reactos/subsys/system/cmd/prompt.c
--- trunk/reactos/subsys/system/cmd/prompt.c	2005-09-03 01:19:25 UTC (rev 17612)
+++ trunk/reactos/subsys/system/cmd/prompt.c	2005-09-03 01:34:40 UTC (rev 17613)
@@ -193,7 +193,7 @@
 
 INT cmd_prompt (LPTSTR cmd, LPTSTR param)
 {
-
+	TCHAR szParam[512];
 	if (!_tcsncmp (param, _T("/?"), 2))
 	{
 		ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
@@ -204,9 +204,13 @@
 		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;