Sfoglia il codice sorgente

[msh] don't complain on empty command

Just branch out and no complain on command length == 0;
Grissiom 11 anni fa
parent
commit
0979328fb1
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      components/finsh/msh.c

+ 3 - 0
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)