kill lua_readline abstraction
This commit is contained in:
parent
9eb951608b
commit
d92a484b91
|
@ -179,7 +179,9 @@ static int pushline (lua_State *L, int firstline) {
|
||||||
char *b = buffer;
|
char *b = buffer;
|
||||||
size_t l;
|
size_t l;
|
||||||
const char *prmt = get_prompt(L, firstline);
|
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 */
|
return 0; /* no input */
|
||||||
l = strlen(b);
|
l = strlen(b);
|
||||||
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
|
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
|
||||||
|
|
|
@ -262,11 +262,6 @@
|
||||||
#define LUA_MAXINPUT 512
|
#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
|
#endif
|
||||||
|
|
||||||
/* }================================================================== */
|
/* }================================================================== */
|
||||||
|
|
Loading…
Reference in New Issue