BAS: output a new line when terminating to separate the last BAS output from the NSH prompt

This commit is contained in:
Gregory Nutt 2014-11-09 09:07:20 -06:00
parent 70797a1c32
commit 894c32d306
2 changed files with 13 additions and 1 deletions

View File

@ -2468,6 +2468,8 @@ void bas_interpreter(void)
void bas_exit(void) void bas_exit(void)
{ {
/* Release resources */
Auto_destroy(&g_stack); Auto_destroy(&g_stack);
Global_destroy(&g_globals); Global_destroy(&g_globals);
Program_destroy(&g_program); Program_destroy(&g_program);
@ -2477,6 +2479,10 @@ void bas_exit(void)
g_labelstack = (struct labelstack_s *)0; 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_closefiles();
FS_close(LPCHANNEL); FS_close(LPCHANNEL);
FS_close(STDCHANNEL); FS_close(STDCHANNEL);

View File

@ -192,6 +192,12 @@ int bas_main(int argc, char *argv[])
bas_interpreter(); 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(); bas_exit();
return (0); return 0;
} }