mirror of https://github.com/skeeto/enchive.git
Fix number of command_names searched (fixes #18)
The "help" subcommand was removed in 6d1407b
, but the number of commands
searched was not updated. With this commit it always checks the right
number of command strings.
pull/23/head
parent
a38e5e3bb9
commit
f01f732433
|
@ -1129,8 +1129,9 @@ parse_command(char *command)
|
|||
{
|
||||
int found = COMMAND_UNKNOWN;
|
||||
size_t len = strlen(command);
|
||||
int ncommands = sizeof(command_names) / sizeof(*command_names);
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
for (i = 0; i < ncommands; i++) {
|
||||
if (strncmp(command, command_names[i], len) == 0) {
|
||||
if (found >= 0)
|
||||
return COMMAND_AMBIGUOUS;
|
||||
|
|
Loading…
Reference in New Issue