1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Fix core getline that doesn't use replacement.

This commit is contained in:
Calvin Rose 2020-04-15 19:45:17 -05:00
parent ef3b953a42
commit f5433dcaa4

View File

@ -435,7 +435,7 @@ static Janet janet_core_hash(int32_t argc, Janet *argv) {
static Janet janet_core_getline(int32_t argc, Janet *argv) { static Janet janet_core_getline(int32_t argc, Janet *argv) {
FILE *in = janet_dynfile("in", stdin); FILE *in = janet_dynfile("in", stdin);
FILE *out = janet_dynfile("out", stdout); FILE *out = janet_dynfile("out", stdout);
janet_arity(argc, 0, 2); janet_arity(argc, 0, 3);
JanetBuffer *buf = (argc >= 2) ? janet_getbuffer(argv, 1) : janet_buffer(10); JanetBuffer *buf = (argc >= 2) ? janet_getbuffer(argv, 1) : janet_buffer(10);
if (argc >= 1) { if (argc >= 1) {
const char *prompt = (const char *) janet_getstring(argv, 0); const char *prompt = (const char *) janet_getstring(argv, 0);