kill lua_readline abstraction

This commit is contained in:
Kartik K. Agaram 2021-10-22 20:36:10 -07:00
parent 9eb951608b
commit d92a484b91
2 changed files with 3 additions and 6 deletions

View File

@ -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? */

View File

@ -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
/* }================================================================== */