From 89414bcf23543f144cd903b894fc06d9b828ab4f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 9 Nov 2014 09:07:20 -0600 Subject: BAS: output a new line when terminating to separate the last BAS output from the NSH prompt --- apps/interpreters/bas/bas.c | 6 ++++++ apps/interpreters/bas/main.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3