Просмотр исходного кода

* Port [3137] to 1.2.13
* For ./binary -C prefer environment variable EDITOR over VISUAL.
* Fix ./binary -C not signalling the correct process under some situations. (fixes #315)


svn: 3138

Bryan Drewery 19 лет назад
Родитель
Сommit
a1e146e17b
2 измененных файлов с 11 добавлено и 5 удалено
  1. 2 0
      doc/UPDATES
  2. 9 5
      src/conf.c

+ 2 - 0
doc/UPDATES

@@ -6,6 +6,8 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fix cmd_chanset accepting invalid flags
 * Fix Auth system not tracking nick changes correctly. (fixes #318)
 * Fix set not allowing defaults under the lower limit. (addresses #315)
+* For ./binary -C prefer environment variable EDITOR over VISUAL.
+* Fix ./binary -C not signalling the correct process under some situations. (fixes #315)
 
 1.2.12 - http://wraith.shatow.net/milestone/1.2.12
 * Clearing a variable via 'set var -' now resets that variable to default settings. (implements #111)

+ 9 - 5
src/conf.c

@@ -213,8 +213,8 @@ confedit()
 
   /* Okay, edit the file */
 
-  if ((!((editor = getenv("VISUAL")) && strlen(editor)))
-      && (!((editor = getenv("EDITOR")) && strlen(editor)))
+  if ((!((editor = getenv("EDITOR")) && strlen(editor)))
+      && (!((editor = getenv("VISUAL")) && strlen(editor)))
     ) {
     editor = "vi";
 /*
@@ -313,8 +313,7 @@ confedit()
   }
 
   localhub = conf_getlocalhub(conf.bots);
-  if (localhub && localhub->pid)
-    localhub_pid = localhub->pid;
+
   tmpconf.my_close();
   free_conf();
   readconf((const char *) tmpconf.file, 0);               /* read cleartext conf tmp into &settings */
@@ -322,8 +321,13 @@ confedit()
   expand_tilde(&conf.datadir);
   unlink(tmpconf.file);
   conf_to_bin(&conf, 0, -1);
-  if (localhub_pid)
+
+  /* Lookup the pid now in case it changed while in the editor */
+  if (localhub) {
+    localhub->pid = localhub_pid = checkpid(localhub->nick, localhub, NULL);
     kill(localhub_pid, SIGUSR1);
+  }
+
   exit(0);
 
 fatal: