Quellcode durchsuchen

* Fixed binary exiting with ERR_NOBOTS under conditions that it shouldn't. (updating)

svn: 1894
Bryan Drewery vor 21 Jahren
Ursprung
Commit
691c6ef789
3 geänderte Dateien mit 8 neuen und 4 gelöschten Zeilen
  1. 1 0
      doc/UPDATES
  2. 3 3
      src/conf.c
  3. 4 1
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -31,6 +31,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * After you edit a binary with -C, the first bot will be sent a signal to reload the data from the binary.
   (Fixes old bots/uname/data showing up in conf after bot is updated)
 * Fixed some bad passes being generated/set beginning with -/+
+* Fixed binary exiting with ERR_NOBOTS under conditions that it shouldn't. (updating)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 3 - 3
src/conf.c

@@ -473,9 +473,6 @@ free_conf_bots(void)
 int
 parseconf(bool error)
 {
-  if (error && !conf.bots->nick && !conf.bots->next)     /* no bots ! */
-    werr(ERR_NOBOTS);
-
   if (conf.username) {
     str_redup(&conf.username, my_username());
   } else {
@@ -789,6 +786,9 @@ fill_conf_bot()
   conf_bot *me = NULL;
   char *mynick = NULL;
 
+  if (!conf.bots || !conf.bots->nick)
+    return;
+
   if (localhub && conf.bots && conf.bots->nick) {
     mynick = strdup(conf.bots->nick);
     strlcpy(origbotname, conf.bots->nick, NICKLEN + 1);

+ 4 - 1
src/main.c

@@ -566,7 +566,7 @@ static void startup_checks(int hack) {
 #endif /* !CYGWIN_HACKS */
 
   fill_conf_bot();
-  if (!conf.bot->hub && conf.bot->localhub && !used_B) {
+  if (((!conf.bot || !conf.bot->nick) || (!conf.bot->hub && conf.bot->localhub)) && !used_B) {
     if (do_killbot[0]) {
       const char *what = (kill_sig == SIGKILL ? "kill" : "restart");
 
@@ -591,6 +591,9 @@ static void startup_checks(int hack) {
         /* never reached */
         exit(0);
       }
+      if (!conf.bots || !conf.bots->nick)     /* no bots ! */
+        werr(ERR_NOBOTS);
+
       spawnbots();
       exit(0); /* our job is done! */
     }