Author: cazfi
Date: Fri Aug 28 20:24:03 2015
New Revision: 29708

URL: http://svn.gna.org/viewcvs/freeciv?rev=29708&view=rev
Log:
Fixed user_home_dir() to correctly build up the home dir information again if
it has been cleared since previous call. That never happens with current 
codebase.

See bug #23823

Modified:
    trunk/utility/shared.c

Modified: trunk/utility/shared.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.c?rev=29708&r1=29707&r2=29708&view=diff
==============================================================================
--- trunk/utility/shared.c      (original)
+++ trunk/utility/shared.c      Fri Aug 28 20:24:03 2015
@@ -732,10 +732,10 @@
 #ifdef AMIGA
   return "PROGDIR:";
 #else  /* AMIGA */
-  static bool init = FALSE;
-
-  if (!init) {
+
+  if (home_dir == NULL) {
     char *env = getenv("HOME");
+
     if (env) {
       home_dir = fc_strdup(env);
       log_verbose("HOME is %s", home_dir);
@@ -788,7 +788,6 @@
       home_dir = NULL;
 #endif /* WIN32_NATIVE */
     }
-    init = TRUE;
   }
 
   return home_dir;


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

Reply via email to