Ver código fonte

* No longer enforcing $binpath/$binname when using -C.

svn: 1701
Bryan Drewery 21 anos atrás
pai
commit
7a80c85bf4
5 arquivos alterados com 9 adições e 5 exclusões
  1. 1 0
      doc/UPDATES
  2. 5 2
      src/binary.c
  3. 1 1
      src/binary.h
  4. 1 1
      src/conf.c
  5. 1 1
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -53,6 +53,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * Fixed irc authing only working on +c bots (should be like this, but isnt needed soon)
 * Fixed chanset limit not being set every 2 minutes.
 * '~' replacement is now internal for paths in config.
+* No longer enforcing $binpath/$binname when using -C.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 5 - 2
src/binary.c

@@ -347,7 +347,7 @@ clear_settings(void)
   memset(&settings.bots, 0, sizeof(settings_t) - 3467);
 }
 
-void conf_to_bin(conf_t *in)
+void conf_to_bin(conf_t *in, bool move)
 {
   conf_bot *bot = NULL;
   char *newbin = NULL;
@@ -377,7 +377,10 @@ void conf_to_bin(conf_t *in)
                            bot->net.ip6 ? bot->net.ip6 : "");
     }
 
-  newbin = move_bin(in->binpath, in->binname, 0);
+  if (move)
+    newbin = move_bin(in->binpath, in->binname, 0);
+  else
+    newbin = binname;
   /* tellconfig(&settings); */
   write_settings(newbin, 1);
 }

+ 1 - 1
src/binary.h

@@ -10,5 +10,5 @@ extern int checked_bin_buf;
 
 void check_sum(const char *, const char *);
 void write_settings(const char *, int);
-void conf_to_bin(conf_t *);
+void conf_to_bin(conf_t *, bool);
 #endif /* !_BINARY_H */

+ 1 - 1
src/conf.c

@@ -238,7 +238,7 @@ confedit()
     fatal("Error reading new config file", 0);
   readconf((const char *) tmpconf.file, 0);               /* read cleartext conf tmp into &settings */
   unlink(tmpconf.file);
-  conf_to_bin(&conffile);       /* will exit */
+  conf_to_bin(&conffile, 0);       /* will exit */
   exit(0);                      /* never reached */
 
 fatal:

+ 1 - 1
src/main.c

@@ -297,7 +297,7 @@ static void dtx_arg(int argc, char *argv[])
       case '4':
         readconf(optarg, CONF_ENC);
         parseconf(0);
-        conf_to_bin(&conffile);		/* this will exit() in write_settings() */
+        conf_to_bin(&conffile, 1);		/* this will exit() in write_settings() */
 #ifdef LEAF
       case 'B':
         localhub = 0;