summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/console.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index e59760237d..077bd28b13 100644
--- a/common/console.c
+++ b/common/console.c
@@ -80,6 +80,12 @@ static const struct console_command *find_command(char *name)
if (!strncasecmp(name, cmd->name, match_length)) {
if (match)
return NULL;
+ /*
+ * Check if 'cmd->name' is of the same length as
+ * 'name'. If yes, then we have a full match.
+ */
+ if (cmd->name[match_length] == '\0')
+ return cmd;
match = cmd;
}
}