summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_script.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-18 09:39:16 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-18 09:39:16 -0600
commitc9e72e0eed21a1c8c679bc094b0960dabf31c84d (patch)
tree9ef30c27fc3d15efa8db04cb1112d916316f3998 /apps/nshlib/nsh_script.c
parent1cc717520d36623c08f8b60f9cd7fede1bd8f1c1 (diff)
downloadnuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.tar.gz
nuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.tar.bz2
nuttx-c9e72e0eed21a1c8c679bc094b0960dabf31c84d.zip
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
Diffstat (limited to 'apps/nshlib/nsh_script.c')
-rw-r--r--apps/nshlib/nsh_script.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/nshlib/nsh_script.c b/apps/nshlib/nsh_script.c
index e5c1958a1..b115dc8fb 100644
--- a/apps/nshlib/nsh_script.c
+++ b/apps/nshlib/nsh_script.c
@@ -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 */