From d92a484b915e8c5b6248bc553d9906dc1f6de2d0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 22 Oct 2021 20:36:10 -0700 Subject: kill lua_readline abstraction --- src/lua.c | 4 +++- src/luaconf.h | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lua.c b/src/lua.c index 1f2953f..59be9de 100644 --- a/src/lua.c +++ b/src/lua.c @@ -179,7 +179,9 @@ static int pushline (lua_State *L, int firstline) { char *b = buffer; size_t l; const char *prmt = get_prompt(L, firstline); - if (lua_readline(L, b, prmt) == 0) + fputs(prmt, stdout); + fflush(stdout); + if (fgets(buffer, LUA_MAXINPUT, stdin) == NULL) return 0; /* no input */ l = strlen(b); if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ diff --git a/src/luaconf.h b/src/luaconf.h index c0af7e0..ebf6682 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -262,11 +262,6 @@ #define LUA_MAXINPUT 512 -/* No readline */ -#define lua_readline(L,b,p) \ - ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ - fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ - #endif /* }================================================================== */ -- cgit 1.4.1-2-gfad0