Jelajahi Sumber

* Port [3717] to 1.2.15
* Fix case where binpath/datadir were not updated correctly when homedir changed. (fixes #169)



svn: 3718

Bryan Drewery 18 tahun lalu
induk
melakukan
0117a0aa40
2 mengubah file dengan 8 tambahan dan 1 penghapusan
  1. 2 1
      doc/UPDATES
  2. 6 0
      src/conf.c

+ 2 - 1
doc/UPDATES

@@ -22,7 +22,8 @@
 * Fix some cases where the bot would pointlessly do WHO on users instead of on the channel to resolve a desync.
 * Fix the bot not starting up when it is not allowed to run ptrace() (FreeBSD: security.bsd.unprivileged_proc_debug=0)
 * Misc help cleanups
-* Show kline reasons on connect to servers. (Fixes #400)
+* Show kline reasons on connect to servers. (fixes #400)
+* Fix case where binpath/datadir were not updated correctly when homedir changed. (fixes #169)
 
 1.2.14 - http://wraith.botpack.net/milestone/1.2.14
 * Fix another bug in shell functions. (fixes #321)

+ 6 - 0
src/conf.c

@@ -879,6 +879,9 @@ writeconf(char *filename, FILE * stream, int bits)
   if (homedir() && strstr(conf.binpath, homedir())) {
     p = replace(conf.binpath, homedir(), "~");
     my_write(f, "! binpath %s\n", p);
+  } else if (conf.homedir && strstr(conf.binpath, conf.homedir)) { /* Could be an older homedir */
+    p = replace(conf.binpath, conf.homedir, "~");
+    my_write(f, "! binpath %s\n", p);
   } else
     my_write(f, "! binpath %s\n", conf.binpath);
 
@@ -891,6 +894,9 @@ writeconf(char *filename, FILE * stream, int bits)
   if (homedir() && strstr(conf.datadir, homedir())) {
     p = replace(conf.datadir, homedir(), "~");
     my_write(f, "! datadir %s\n", p);
+  } else if (conf.homedir && strstr(conf.datadir, conf.homedir)) { /* Could be an older homedir */
+    p = replace(conf.datadir, conf.homedir, "~");
+    my_write(f, "! datadir %s\n", p);
   } else
     my_write(f, "! datadir %s\n", conf.datadir);