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:
@@ -81,6 +81,8 @@ find_command(char *name)
|
|||||||
if (strncmp(name, command->name, length) == 0)
|
if (strncmp(name, command->name, length) == 0)
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -324,9 +326,11 @@ cmd_help(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
debugger_command *command, *specified = NULL;
|
debugger_command *command, *specified = NULL;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1)
|
||||||
// only print out the help of the specified command (and all of its aliases)
|
|
||||||
specified = find_command(argv[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);
|
dprintf("debugger command for \"%s\" and aliases:\n", specified->name);
|
||||||
} else
|
} else
|
||||||
dprintf("debugger commands:\n");
|
dprintf("debugger commands:\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user