Ver Fonte

* Fixed '+ban' not showing up in help system.

svn: 1745
Bryan Drewery há 21 anos atrás
pai
commit
ce468ad09b
3 ficheiros alterados com 6 adições e 8 exclusões
  1. 1 0
      doc/UPDATES
  2. 4 7
      src/cmds.c
  3. 1 1
      src/tclhash.c

+ 1 - 0
doc/UPDATES

@@ -9,6 +9,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed.
 * Fixed limit, wasn't correclty checking *each chan* every *2* minutes.
 * Fixed DNS to timeout queries after 30 seconds, server socket after 40, and to parse EOF correctly.
 * Added some responses/cloaks
+* Fixed '+ban' not showing up in help system.
 
 1.2.1
 

+ 4 - 7
src/cmds.c

@@ -697,11 +697,7 @@ static void cmd_nohelp(int idx, char *par)
   qsort(cmdlist, cmdi, sizeof(mycmds), (int (*)(const void *, const void *)) &my_cmp);
   
   for (int i = 0; i < cmdi; i++) {
-    int found = 0;
-
-    for (int o = 0; (help[o].cmd) && (help[o].desc); o++)
-      if (!egg_strcasecmp(help[o].cmd, cmdlist[i].name)) found++;
-    if (!found) {
+    if (findhelp(cmdlist[i].name) != -1) {
       buf = (char *) my_realloc(buf, strlen(buf) + 2 + strlen(cmdlist[i].name) + 1);
       strcat(buf, cmdlist[i].name);
       strcat(buf, ", ");
@@ -718,7 +714,8 @@ findhelp(const char *cmd)
   for (int hi = 0; (help[hi].cmd) && (help[hi].desc); hi++)
     if (!egg_strcasecmp(cmd, help[hi].cmd))
       return hi;
-  return 0;
+
+  return -1;
 }
 
 static void cmd_help(int idx, char *par)
@@ -763,7 +760,7 @@ static void cmd_help(int idx, char *par)
         flg[0] = 0;
         build_flags(flg, &(cmdlist[n].flags), NULL);
         dprintf(idx, "Showing you help for '%s' (%s):\n", match, flg);
-        if ((hi = findhelp(match))) {
+        if ((hi = findhelp(match)) != -1) {
           if (help[hi].garble)
             showhelp(idx, &fr, degarble(help[hi].garble, help[hi].desc));
           else

+ 1 - 1
src/tclhash.c

@@ -455,7 +455,7 @@ void add_builtins(const char *table_name, cmd_t *cmds)
 
 	for (; cmds->name; cmds++) {
                 /* add BT_dcc cmds to cmdlist[] :: add to the help system.. */
-                if (!strcmp(table->name, "dcc") && findhelp(cmds->name)) {
+                if (!strcmp(table->name, "dcc") && (findhelp(cmds->name) != -1)) {
                   cmdlist[cmdi].name = cmds->name;
                   cmdlist[cmdi].flags.match = FR_GLOBAL | FR_CHAN;
                   break_down_flags(cmds->flags, &(cmdlist[cmdi].flags), NULL);