diff --git a/components/finsh/msh.c b/components/finsh/msh.c index 354f884913cd61d75557b292bd456b0672275a59..1492e017e14f1670abe47f2a07460952c602ce43 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -292,6 +292,9 @@ int msh_exec(char* cmd, rt_size_t length) length--; } + if (length == 0) + return 0; + /* Exec sequence: * 1. built-in command * 2. module(if enabled)