Fix unwanted newlines in Lua output.

The old NodeMCU puts() did not do the standard newline, while the RTOS C
library one certainly does.
This commit is contained in:
Johny Mattsson 2016-06-01 14:15:13 +10:00
parent 61291bd87b
commit 740c06b48f
2 changed files with 4 additions and 4 deletions

View File

@ -533,7 +533,7 @@ static void dojob(lua_Load *load){
load->done = 0; load->done = 0;
load->line_position = 0; load->line_position = 0;
memset(load->line, 0, load->len); memset(load->line, 0, load->len);
puts(load->prmt); printf(load->prmt);
} }
#ifndef uart_putc #ifndef uart_putc
@ -599,7 +599,7 @@ static bool readline(lua_Load *load){
if (load->line_position == 0) if (load->line_position == 0)
{ {
/* Get a empty line, then go to get a new line */ /* Get a empty line, then go to get a new line */
puts(load->prmt); printf(load->prmt);
} else { } else {
load->done = 1; load->done = 1;
need_dojob = true; need_dojob = true;

View File

@ -332,8 +332,8 @@ extern int readline4lua(const char *prompt, char *buffer, int length);
** avoids including 'stdio.h' everywhere.) ** avoids including 'stdio.h' everywhere.)
*/ */
#if !defined(LUA_USE_STDIO) #if !defined(LUA_USE_STDIO)
#define luai_writestring(s, l) puts(s) #define luai_writestring(s, l) printf(s)
#define luai_writeline() puts("\n") #define luai_writeline() puts("")
#endif // defined(LUA_USE_STDIO) #endif // defined(LUA_USE_STDIO)
/* /*