diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-10-22 20:36:10 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-10-22 20:37:56 -0700 |
commit | d92a484b915e8c5b6248bc553d9906dc1f6de2d0 (patch) | |
tree | 3b9d9375dd7d12c5484eef95cd637e675650f5f0 | |
parent | 9eb951608b3da86dd5d4cc81a799dcbd78f98736 (diff) | |
download | teliva-d92a484b915e8c5b6248bc553d9906dc1f6de2d0.tar.gz |
kill lua_readline abstraction
-rw-r--r-- | src/lua.c | 4 | ||||
-rw-r--r-- | src/luaconf.h | 5 |
2 files changed, 3 insertions, 6 deletions
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 /* }================================================================== */ |