summaryrefslogtreecommitdiff
path: root/apps/interpreters
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-09 09:07:20 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-09 17:14:15 -0600
commit89414bcf23543f144cd903b894fc06d9b828ab4f (patch)
tree858610332ef06f236405a12529a1399a9653981b /apps/interpreters
parent9841662b793e12c132e36b9e5a3fa4c62f2aa91e (diff)
downloadnuttx-89414bcf23543f144cd903b894fc06d9b828ab4f.tar.gz
nuttx-89414bcf23543f144cd903b894fc06d9b828ab4f.tar.bz2
nuttx-89414bcf23543f144cd903b894fc06d9b828ab4f.zip
BAS: output a new line when terminating to separate the last BAS output from the NSH prompt
Diffstat (limited to 'apps/interpreters')
-rw-r--r--apps/interpreters/bas/bas.c6
-rw-r--r--apps/interpreters/bas/main.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/apps/interpreters/bas/bas.c b/apps/interpreters/bas/bas.c
index 63f9c69d8..0ab8eaf3d 100644
--- a/apps/interpreters/bas/bas.c
+++ b/apps/interpreters/bas/bas.c
@@ -2468,6 +2468,8 @@ void bas_interpreter(void)
void bas_exit(void)
{
+ /* Release resources */
+
Auto_destroy(&g_stack);
Global_destroy(&g_globals);
Program_destroy(&g_program);
@@ -2477,6 +2479,10 @@ void bas_exit(void)
g_labelstack = (struct labelstack_s *)0;
}
+ /* Close files and devices. NOTE that STDCHANNEL is also close here and
+ * can no longer be use
+ */
+
FS_closefiles();
FS_close(LPCHANNEL);
FS_close(STDCHANNEL);
diff --git a/apps/interpreters/bas/main.c b/apps/interpreters/bas/main.c
index c772119eb..fce6dd672 100644
--- a/apps/interpreters/bas/main.c
+++ b/apps/interpreters/bas/main.c
@@ -192,6 +192,12 @@ int bas_main(int argc, char *argv[])
bas_interpreter();
}
+ /* Terminate the output stream with a newline BEFORE closing devices */
+
+ FS_putChar(STDCHANNEL, '\n');
+
+ /* Release resouces and close files and devices */
+
bas_exit();
- return (0);
+ return 0;
}