]> git.mxchange.org Git - flightgear.git/commitdiff
MSVC fix.
authorehofman <ehofman>
Sun, 18 Dec 2005 09:35:01 +0000 (09:35 +0000)
committerehofman <ehofman>
Sun, 18 Dec 2005 09:35:01 +0000 (09:35 +0000)
src/Main/fg_commands.cxx
src/Main/fg_init.cxx

index a23b5355e998cf379df684fbfc4f5a3758464078..f2189ad57496008e39db7d9b344c08cc534bfe6a 100644 (file)
@@ -191,11 +191,19 @@ do_exit (const SGPropertyNode * arg)
 {
     SG_LOG(SG_INPUT, SG_INFO, "Program exit requested.");
 
+#ifdef _MSC_VER
+    char* envp = ::getenv( "APPDATA" );
+#else
     char* envp = ::getenv( "HOME" );
+#endif
     if ( envp != NULL ) {
         SGPath config( globals->get_fg_root() );
         config.set( envp );
+#ifdef _MSC_VER
+        config.append( "flightgear.org" );
+#else
         config.append( ".fgfs" );
+#endif
         config.append( "preferences.xml" );
         config.create_dir( 0700 );
         SG_LOG(SG_IO, SG_INFO, "Saving user preferences");
index e1bb2e56588147861b1dc3b8c9a0fdaeebdba3fb..9cd7bab3857f274cde1bc4ee0cd5e0b863caf1a3 100644 (file)
@@ -607,12 +607,19 @@ bool fgInitConfig ( int argc, char **argv ) {
         SG_LOG( SG_INPUT, SG_ALERT, "No default aircraft specified" );
     }
 
-
+#ifdef _MSC_VER
+    char* envp = ::getenv( "APPDATA" );
+#else
     char* envp = ::getenv( "HOME" );
+#endif
     if ( envp != NULL ) {
         SGPath config( globals->get_fg_root() );
         config.set( envp );
+#ifdef _MSC_VER
+        config.append( "flightgear.org" );
+#else
         config.append( ".fgfs" );
+#endif
         config.append( "preferences.xml" );
         SG_LOG(SG_INPUT, SG_INFO, "Reading user preferences");
         fgLoadProps(config.str().c_str(), globals->get_props(), false, SGPropertyNode::USERARCHIVE);