From 6cc98cb9954bcdd30e81feddf9721edabdae4fec Mon Sep 17 00:00:00 2001
From: "Rebecca N. Palmer" <rebecca_palmer@zoho.com>
Date: Fri, 20 Mar 2015 18:56:13 +0000
Subject: [PATCH] Improve error messages for system.fgfsrc removal

The original message (b5835c38b4fb86262a1ebb24da34d7531c204c6d)
was meaningless on Windows
---
 src/Main/options.cxx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index 5a2e4b46b..9b69c16b7 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1942,6 +1942,7 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
   
 // system.fgfsrc is disabled, as we no longer allow anything in fgdata to set
 // fg-root/fg-home/fg-aircraft and hence control what files Nasal can access
+  std::string name_for_error = homedir.empty() ? appDataConfig.str() : config.str();
   if( ! hostname.empty() ) {
     config.set(globals->get_fg_root());
     config.append( "system.fgfsrc" );
@@ -1949,8 +1950,8 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
     config.concat( hostname );
     if (config.exists()) {
       flightgear::fatalMessageBox("Unsupported configuration",
-        "You have a system.fgfsrc." + hostname +" file, which is no longer processed for security reasons",
-        "If you created this file intentionally, please move it to ~/.fgfsrc" );
+        "You have a " + config.str() + " file, which is no longer processed for security reasons",
+        "If you created this file intentionally, please move it to " + name_for_error);
     }
   }
 
@@ -1958,8 +1959,8 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
   config.append( "system.fgfsrc" );
   if (config.exists()) {
     flightgear::fatalMessageBox("Unsupported configuration",
-      "You have a system.fgfsrc file, which is no longer processed for security reasons",
-      "If you created this file intentionally, please move it to ~/.fgfsrc" );
+      "You have a " + config.str() + " file, which is no longer processed for security reasons",
+      "If you created this file intentionally, please move it to " + name_for_error);
   }
 }