From acb0c260366e2a235ee6623be32fd50bcc7f1702 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Sat, 3 Sep 2005 11:51:22 +0000 Subject: [PATCH] Setting my changes back for prompt.c. Greatlord and I agreed about this. These was a miscommication about these changes and the way different MS version handle it. svn path=/trunk/; revision=17620 --- reactos/subsys/system/cmd/prompt.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/cmd/prompt.c b/reactos/subsys/system/cmd/prompt.c index a4dddeed560..0ef0bac23bd 100644 --- a/reactos/subsys/system/cmd/prompt.c +++ b/reactos/subsys/system/cmd/prompt.c @@ -204,12 +204,20 @@ INT cmd_prompt (LPTSTR cmd, LPTSTR param) return 0; } - /* set PROMPT environment variable */ + /* if it is null, then it needs to set to default, + because that means the user entered "prompt" only. + so even if param is null you _must_ still set prompt + to the default. There seems to be some kinda difference + between winxp and 2k in this matter and this way will + cover both. */ if (param[0] != _T('\0')) - { - if (!SetEnvironmentVariable (_T("PROMPT"), param)) - return 1; - } + _tcscpy(szParam,param); + else + _tcscpy(szParam,_T("$P$G")); + + /* set PROMPT environment variable */ + if (!SetEnvironmentVariable (_T("PROMPT"), szParam)) + return 1; return 0; }