Quellcode durchsuchen

* Port [3748] to 1.2.15
* Hide autocron unless set to 0
* Accept '!option' and old '! option' in binary config



svn: 3749

Bryan Drewery vor 18 Jahren
Ursprung
Commit
d8b249444c
2 geänderte Dateien mit 12 neuen und 6 gelöschten Zeilen
  1. 1 2
      doc/UPDATES
  2. 11 4
      src/conf.c

+ 1 - 2
doc/UPDATES

@@ -10,7 +10,7 @@
 * Added new chanset flag '+knock' which will make +y bots auto invite USERS. (No flag restrictions currently)
 * Bots now check their own hostmask before opping or requesting assistance to join a channel
 * Fix bans not being removed from channels when removed from bot. (fixes #352)
-* Dont show portmin/portmax/pscloak/autouname in binary config unless they are set
+* Dont show portmin/portmax/pscloak/autouname/datadir/autocron in binary config unless they are not set to the default
 * Fix possible situation where an error while saving userfile is not reported (fixes #287)
 * Fix a bug where some nets did not save userfile correctly
 * Fix a case where 'botcmd ?' would loop forever when a hub had a 1 character handle
@@ -27,7 +27,6 @@
 * For security purposes the following commands are now hub-only: botnick, botserver, botversion, botmsg, netnick, netserver, netversion
 * Added cmd_nick to display leaf's current nick
 * Change default ip/host/ip6 to a * in the binary config
-* Hide datadir if it is set to the default in the binary config
 * Silently fix user mistake of giving hostname in ip field in binary config
 * Fix datadir being expanded to full path (fixes #405)
 

+ 11 - 4
src/conf.c

@@ -707,7 +707,12 @@ readconf(const char *fname, int bits)
       } else if (line[0] == '!') {
         char *option = NULL;
 
-        newsplit(&line);
+        /* Only newplit if they did '! option' */
+        if (line[1] == ' ')
+          newsplit(&line);
+        else
+          ++line;
+
         if (line[0])
           option = newsplit(&line);
 
@@ -927,10 +932,12 @@ writeconf(char *filename, FILE * stream, int bits)
     comment("");
   }
 
-  comment("# Automatically add the bot to crontab?");
-  my_write(f, "! autocron %d\n", conf.autocron);
+  if (conf.autocron == 0) {
+    comment("# Automatically add the bot to crontab?");
+    my_write(f, "! autocron %d\n", conf.autocron);
 
-  comment("");
+    comment("");
+  }
 
   if (conf.autouname) {
     comment("# Automatically update 'uname' if it changes? (DANGEROUS)");