find_command() did not return NULL if it couldn't find a command, courtesy

of Jack Burton.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7061 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-03-23 15:42:39 +00:00
parent 56c7aeaee8
commit 1ed3192432

View File

@ -81,6 +81,8 @@ find_command(char *name)
if (strncmp(name, command->name, length) == 0)
return command;
}
return NULL;
}
@ -324,9 +326,11 @@ cmd_help(int argc, char **argv)
{
debugger_command *command, *specified = NULL;
if (argc > 1) {
// only print out the help of the specified command (and all of its aliases)
if (argc > 1)
specified = find_command(argv[1]);
if (specified != NULL) {
// only print out the help of the specified command (and all of its aliases)
dprintf("debugger command for \"%s\" and aliases:\n", specified->name);
} else
dprintf("debugger commands:\n");