diff options
Diffstat (limited to 'apps')
-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; } |