- if ( strncasecmp(s, (*result)->pc_name, strlen((*result)->pc_name)) &&
- find_cmd(s, (*result) + 1, next))
- return CMD_AMBIG;
+ if (strncasecmp(s, (*result)->pc_name, strlen((*result)->pc_name))) {
+ char *another_next;
+ command_t *another_result = find_cmd(s, (*result) + 1,
+ &another_next);
+ int found_another = 0;
+
+ while (another_result) {
+ if (strncasecmp(s, another_result->pc_name,
+ strlen(another_result->pc_name)) == 0){
+ *result = another_result;
+ *next = another_next;
+ goto got_it;
+ }
+ another_result = find_cmd(s, another_result + 1,
+ &another_next);
+ found_another = 1;
+ }
+ if (found_another)
+ return CMD_AMBIG;
+ }