mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 12:55:43 +08:00
NSH: Add a break command; if-then-else and looping behavior can not be configured out of the build for small systems that need minimal scripting capability
This commit is contained in:
@@ -129,10 +129,11 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
||||
|
||||
do
|
||||
{
|
||||
/* Get the next line of input from the file */
|
||||
/* Flush any output generated by the previous line */
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLE_LOOPS
|
||||
/* Get the current file position. This is used to control
|
||||
* looping. If a loop begins in the next line, then this file
|
||||
* offset will be needed to locate the top of the loop in the
|
||||
@@ -146,6 +147,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
||||
{
|
||||
nsh_output(vtbl, g_fmtcmdfailed, "loop", "ftell", NSH_ERRNO);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now read the next line from the script file */
|
||||
|
||||
|
Reference in New Issue
Block a user