Allow $COMSPEC to be given in the config file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog:
	files/directory.c, ocumentation/samples/config
	Read COMSPEC from the config file
-- 
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/files/directory.c
===================================================================
RCS file: /home/wine/wine/files/directory.c,v
retrieving revision 1.51
diff -u -r1.51 directory.c
--- wine/files/directory.c	27 Aug 2002 01:13:59 -0000	1.51
+++ wine/files/directory.c	7 Sep 2002 23:02:19 -0000
@@ -92,6 +92,7 @@
 {
     char path[MAX_PATHNAME_LEN];
     WCHAR longpath[MAX_PATHNAME_LEN];
+    WCHAR comspec[MAX_PATHNAME_LEN];
     DOS_FULL_NAME tmp_dir, profile_dir;
     int drive;
     const char *cwd;
@@ -111,6 +112,8 @@
     static const WCHAR winsysdirW[] = {'w','i','n','s','y','s','d','i','r',0};
     static const WCHAR userprofileW[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
     static const WCHAR systemrootW[] = {'S','Y','S','T','E','M','R','O','O','T',0};
+    static const WCHAR comspecW[] = {'C','O','M','S','P','E','C',0};
+    static const WCHAR def_comspecW[] = {'C',':','\\','C','O','M','M','A','N','D','.','C','O','M',0};
     static const WCHAR empty_strW[] = { 0 };
 
     if (!getcwd( path, MAX_PATHNAME_LEN ))
@@ -178,8 +181,13 @@
     SetEnvironmentVariableW( winsysdirW, DIR_System.short_name );
 
     /* set COMSPEC only if it doesn't exist already */
-    if (!GetEnvironmentVariableA( "COMSPEC", NULL, 0 ))
-        SetEnvironmentVariableA( "COMSPEC", "c:\\command.com" );
+    if (!GetEnvironmentVariableW( comspecW, NULL, 0 ))
+      {
+	PROFILE_GetWineIniString(wineW, comspecW, def_comspecW, comspec, MAX_PATHNAME_LEN);
+        SetEnvironmentVariableW( comspecW, comspec );
+      }
+    if (GetEnvironmentVariableW( comspecW, comspec, MAX_PATHNAME_LEN ))
+    TRACE("COMSPEC = %s\n",debugstr_w(comspec));
 
     TRACE("WindowsDir = %s (%s)\n",
           debugstr_w(DIR_Windows.short_name), DIR_Windows.long_name );
Index: wine/documentation/samples/config
===================================================================
RCS file: /home/wine/wine/documentation/samples/config,v
retrieving revision 1.28
diff -u -r1.28 config
--- wine/documentation/samples/config	10 Jul 2002 23:08:32 -0000	1.28
+++ wine/documentation/samples/config	7 Sep 2002 23:04:07 -0000
@@ -68,6 +68,7 @@
 ; subdir tree in case of a symlink pointing back to itself.
 ;"ShowDirSymlinks" = "1"
 "ShellLinker" = "wineshelllink"
+"Comspec" = "c:\\command.com"
 
 # <wineconf>
 


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux