Author: cazfi
Date: Sat Oct 10 19:55:19 2015
New Revision: 30039

URL: http://svn.gna.org/viewcvs/freeciv?rev=30039&view=rev
Log:
Corrected path to client options file.

See bug #23927

Modified:
    trunk/client/options.c

Modified: trunk/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=30039&r1=30038&r2=30039&view=diff
==============================================================================
--- trunk/client/options.c      (original)
+++ trunk/client/options.c      Sat Oct 10 19:55:19 2015
@@ -4774,7 +4774,7 @@
       return NULL;
     }
     fc_snprintf(name_buffer, sizeof(name_buffer),
-                "%s/.freeciv/" NEW_OPTION_FILE_NAME, name,
+                "%s/" NEW_OPTION_FILE_NAME, name,
                 MAJOR_NEW_OPTION_FILE_NAME, MINOR_NEW_OPTION_FILE_NAME);
 #endif /* OPTION_FILE_NAME */
   }
@@ -4813,11 +4813,13 @@
     int major, minor;
     struct stat buf;
 
-    name = user_home_dir();
-    if (!name) {
-      log_error(_("Cannot find your home directory"));
+    name = freeciv_home_dir();
+    if (name == NULL) {
+      log_error(_("Cannot find freeciv storage directory"));
+
       return NULL;
     }
+
     for (major = MAJOR_NEW_OPTION_FILE_NAME,
          minor = MINOR_NEW_OPTION_FILE_NAME;
          major >= FIRST_MAJOR_NEW_OPTION_FILE_NAME; major--) {
@@ -4825,7 +4827,7 @@
               ? minor >= FIRST_MINOR_NEW_OPTION_FILE_NAME 
               : minor >= 0); minor--) {
         fc_snprintf(name_buffer, sizeof(name_buffer),
-                    "%s/.freeciv/" NEW_OPTION_FILE_NAME, name, major, minor);
+                    "%s/" NEW_OPTION_FILE_NAME, name, major, minor);
         if (0 == fc_stat(name_buffer, &buf)) {
           if (MAJOR_NEW_OPTION_FILE_NAME != major
               || MINOR_NEW_OPTION_FILE_NAME != minor) {
@@ -4839,6 +4841,14 @@
         }
       }
       minor = last_minors[major - 1];
+    }
+
+    /* Older versions had options file in user home directory */
+    name = user_home_dir();
+    if (name == NULL) {
+      log_error(_("Cannot find your home directory"));
+
+      return NULL;
     }
 
     /* minor having max value of FIRST_MINOR_NEW_OPTION_FILE_NAME


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to