From 1ed3192432cac5d39e26cb983fb4786ba94ad9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 23 Mar 2004 15:42:39 +0000 Subject: [PATCH] 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 --- src/kernel/core/debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/debug.c b/src/kernel/core/debug.c index 4e51a86e85..145854a020 100644 --- a/src/kernel/core/debug.c +++ b/src/kernel/core/debug.c @@ -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");