From 8cfcbfedf8e0e7d4d4f17f96ce0296124969a41b Mon Sep 17 00:00:00 2001 From: MacRsh Date: Thu, 19 Dec 2024 23:34:29 +0800 Subject: [PATCH] fix(msh): Fixed command identification errors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.Originally, "strncmp" was used, and the length was command length, and when the input was the same as the length of the command, the condition was passed incorrectly, causing a problem (feedback from "下一站 还是站"). --- components/msh/msh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/msh/msh.c b/components/msh/msh.c index f0f3453..bb3a07c 100644 --- a/components/msh/msh.c +++ b/components/msh/msh.c @@ -235,7 +235,7 @@ MR_INLINE void msh_parse_cmd(void) for (const struct mr_msh_cmd *msh_cmd = ((&_mr_msh_cmd_start) + 1); msh_cmd < &_mr_msh_cmd_end; msh_cmd++) { - if (strncmp(msh_cmd->name, msh.buf, strlen(msh_cmd->name)) != 0) { + if (strcmp(msh_cmd->name, msh.buf) != 0) { continue; }