+
+/* Search the input clist for 'command'. Return the command if
+ found (or NULL if not), and return the number of commands
+ found in nfound */
+
+static struct cmd_list_element *
+find_cmd (command, len, clist, ignore_help_classes, nfound)
+ char *command;
+ int len;
+ struct cmd_list_element *clist;
+ int ignore_help_classes;
+ int *nfound;
+{
+ struct cmd_list_element *found, *c;
+
+ found = (struct cmd_list_element *) NULL;
+ *nfound = 0;
+ for (c = clist; c; c = c->next)
+ if (!strncmp (command, c->name, len)
+ && (!ignore_help_classes || c->function.cfunc))
+ {
+ found = c;
+ (*nfound)++;
+ if (c->name[len] == '\0')
+ {
+ *nfound = 1;
+ break;
+ }
+ }
+ return found;
+}
+