From 740c06b48f23e3c84026e3936fbeb446cd158a71 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Wed, 1 Jun 2016 14:15:13 +1000 Subject: [PATCH] Fix unwanted newlines in Lua output. The old NodeMCU puts() did not do the standard newline, while the RTOS C library one certainly does. --- app/lua/lua.c | 4 ++-- app/lua/luaconf.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/lua/lua.c b/app/lua/lua.c index 0a07d224..88baae52 100644 --- a/app/lua/lua.c +++ b/app/lua/lua.c @@ -533,7 +533,7 @@ static void dojob(lua_Load *load){ load->done = 0; load->line_position = 0; memset(load->line, 0, load->len); - puts(load->prmt); + printf(load->prmt); } #ifndef uart_putc @@ -599,7 +599,7 @@ static bool readline(lua_Load *load){ if (load->line_position == 0) { /* Get a empty line, then go to get a new line */ - puts(load->prmt); + printf(load->prmt); } else { load->done = 1; need_dojob = true; diff --git a/app/lua/luaconf.h b/app/lua/luaconf.h index 30c6dd39..2f738801 100644 --- a/app/lua/luaconf.h +++ b/app/lua/luaconf.h @@ -332,8 +332,8 @@ extern int readline4lua(const char *prompt, char *buffer, int length); ** avoids including 'stdio.h' everywhere.) */ #if !defined(LUA_USE_STDIO) -#define luai_writestring(s, l) puts(s) -#define luai_writeline() puts("\n") +#define luai_writestring(s, l) printf(s) +#define luai_writeline() puts("") #endif // defined(LUA_USE_STDIO) /*