diff --git a/components/finsh/msh.c b/components/finsh/msh.c index f7e40c8841a62adfdb881ba4925ffee91f3fafca..f308e70ace6fa87a4c4cd537223e0700418371ef 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -405,7 +405,10 @@ void msh_auto_complete_path(char *path) ptr = path; for (;;) { - if (*ptr == '/') index = ptr + 1; if (!*ptr) break; ptr ++; + if (*ptr == '/') index = ptr + 1; + if (!*ptr) break; + + ptr ++; } if (index == RT_NULL) index = path;