Przeglądaj źródła

* Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.

svn: 2161
Bryan Drewery 21 lat temu
rodzic
commit
398c536399
3 zmienionych plików z 17 dodań i 2 usunięć
  1. 1 0
      doc/UPDATES
  2. 8 1
      src/cmds.c
  3. 8 1
      src/mod/server.mod/cmdsserv.c

+ 1 - 0
doc/UPDATES

@@ -146,6 +146,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed 'bots' not showing up in help, and a typo in 'botpart'.
 * In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)
 * Clearing chanset var now correctly uses defaults.
+* Fixed cmd_jump/cmd_botjump not parsing 'server:port' correctly.
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 8 - 1
src/cmds.c

@@ -3894,9 +3894,16 @@ static void cmd_botjump(int idx, char * par) {
 static void rcmd_jump(char * frombot, char * fromhand, char * fromidx, char * par) {
   if (!conf.bot->hub) {
     if (par[0]) {
-      char *other = newsplit(&par);
+      char *other = newsplit(&par), *p = NULL;
       port_t port = atoi(newsplit(&par));
 
+      if ((p = strchr(other, ':'))) {
+        *p = 0;
+        p++;
+        if (!port)
+          port = atoi(p);
+      }
+
       if (!port)
         port = default_port;
       strlcpy(newserver, other, 120); 

+ 8 - 1
src/mod/server.mod/cmdsserv.c

@@ -46,12 +46,19 @@ static void cmd_dump(int idx, char *par)
 
 static void cmd_jump(int idx, char *par)
 {
-  char *other = NULL;
+  char *other = NULL, *p = NULL;
   int port;
 
   if (par[0]) {
     other = newsplit(&par);
     port = atoi(newsplit(&par));
+
+    if ((p = strchr(other, ':'))) {
+      *p = 0;
+      p++;
+      if (!port)
+        port = atoi(p);
+    }
     if (!port)
       port = default_port;
     putlog(LOG_CMDS, "*", "#%s# jump %s %d %s", dcc[idx].nick, other, port, par);