diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-09 09:07:20 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-09 17:14:15 -0600 |
commit | 89414bcf23543f144cd903b894fc06d9b828ab4f (patch) | |
tree | 858610332ef06f236405a12529a1399a9653981b /apps/interpreters | |
parent | 9841662b793e12c132e36b9e5a3fa4c62f2aa91e (diff) | |
download | px4-nuttx-89414bcf23543f144cd903b894fc06d9b828ab4f.tar.gz px4-nuttx-89414bcf23543f144cd903b894fc06d9b828ab4f.tar.bz2 px4-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.c | 6 | ||||
-rw-r--r-- | apps/interpreters/bas/main.c | 8 |
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; } |