cmd: Do not overwrite a user-specified Prompt variable

Hugh McMaster hugh.mcmaster at outlook.com
Tue Dec 8 02:53:41 CST 2015


Fixes bug 38293. Thanks to Jason Edmeades in the bug's comments section.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/cmd/wcmdmain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index ba7d9ca..bf988f5 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -2422,6 +2422,8 @@ int wmain (int argc, WCHAR *argvW[])
   /* Until we start to read from the keyboard, stay as non-interactive */
   interactive = FALSE;
 
+  SetEnvironmentVariableW(promptW, defaultpromptW);
+
   if (opt_c || opt_k) {
       int     len;
       WCHAR   *q1 = NULL,*q2 = NULL,*p;
@@ -2683,7 +2685,6 @@ int wmain (int argc, WCHAR *argvW[])
  *	Loop forever getting commands and executing them.
  */
 
-  SetEnvironmentVariableW(promptW, defaultpromptW);
   interactive = TRUE;
   if (!opt_k) WCMD_version ();
   while (TRUE) {
-- 
1.9.1




More information about the wine-patches mailing list