Просмотр исходного кода

* Port [3291] to 1.2.14
* Fixed cmd_nohelp (for viewing undocumented cmds - mainly debugging cmds)



svn: 3292

Bryan Drewery 19 лет назад
Родитель
Сommit
4afe4fc6e3
2 измененных файлов с 7 добавлено и 6 удалено
  1. 1 0
      doc/UPDATES
  2. 6 6
      src/cmds.c

+ 1 - 0
doc/UPDATES

@@ -26,6 +26,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fix cmd_swhois returning results after a server jump.
 * Fix bots not connecting to their uplink.
 * Add ghost-inspired feature: backup bots. Bots marked +B will only join channels marked +backup.
+* Fixed cmd_nohelp (for viewing undocumented cmds - mainly debugging cmds)
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 6 - 6
src/cmds.c

@@ -549,13 +549,13 @@ int my_cmp(const mycmds *c1, const mycmds *c2)
 static void cmd_nohelp(int idx, char *par)
 {
   char *buf = (char *) my_calloc(1, 1);
+  bind_entry_t *entry = NULL;
+  bind_table_t *table = bind_table_lookup("dcc");
 
-  qsort(cmdlist, cmdi, sizeof(mycmds), (int (*)(const void *, const void *)) &my_cmp);
-  
-  for (int i = 0; i < cmdi; i++) {
-    if (findhelp(cmdlist[i].name) == -1) {
-      buf = (char *) my_realloc(buf, strlen(buf) + 2 + strlen(cmdlist[i].name) + 1);
-      strcat(buf, cmdlist[i].name);
+  for (entry = table->entries; entry; entry = entry->next) {
+    if (findhelp(entry->mask) == -1) {
+      buf = (char *) my_realloc(buf, strlen(buf) + 2 + strlen(entry->mask) + 1);
+      strcat(buf, entry->mask);
       strcat(buf, ", ");
     }
   }