This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new fa589ae62 nsh: fix nsh startup failure
fa589ae62 is described below

commit fa589ae622cb5b0aceddbaf7f4033ece25d19a2f
Author: yinshengkai <[email protected]>
AuthorDate: Wed Mar 1 17:04:49 2023 +0800

    nsh: fix nsh startup failure
    
    Signed-off-by: yinshengkai <[email protected]>
---
 nshlib/nsh_script.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c
index 9acf681f3..823acef29 100644
--- a/nshlib/nsh_script.c
+++ b/nshlib/nsh_script.c
@@ -165,10 +165,17 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR 
char *cmd,
                   nsh_output(vtbl, "%s", buffer);
                 }
 
-              ret = nsh_parse(vtbl, buffer);
+              if (vtbl->np.np_flags & NSH_PFLAG_IGNORE)
+                {
+                  nsh_parse(vtbl, buffer);
+                }
+              else
+                {
+                  ret = nsh_parse(vtbl, buffer);
+                }
             }
         }
-      while (ret >= 0 || (vtbl->np.np_flags & NSH_PFLAG_IGNORE));
+      while (ret >= 0);
 
       /* Close the script file */
 

Reply via email to