From e96306e75ac59393ab051ca4a85e12533f64d9d6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 3 Jun 2025 20:57:03 -0700 Subject: listener: bugfix: evaluate *listener-egnore-eof* after rcfile. * parser.c (repl): Our first sampling of *listener-ignore-eof* must occur after we load the rcfile, where it is typically configured, otherwise we pick up a nil value. If Ctrl-D is used on the very first command of a session, TXR will then quit in spite of the user having configured the variable. --- parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index bdaa52b3..e2c3d1db 100644 --- a/parser.c +++ b/parser.c @@ -1688,7 +1688,7 @@ val repl(val bindings, val in_stream, val out_stream, val env) val rw_f = func_f1v(out_stream, repl_warning); val saved_dyn_env = set_dyn_env(make_env(nil, nil, dyn_env)); val brackets = mkstring(num_fast(repl_level), chr('>')); - val ignore_eof_count = cdr(ignore_eof); + val ignore_eof_count = nil; cnum i; env_vbind(dyn_env, stderr_s, out_stream); @@ -1722,6 +1722,8 @@ val repl(val bindings, val in_stream, val out_stream, val env) if (home && !opt_noprofile) load_rcfile(home, pexist_s, psafe_s, ppriv_s); + ignore_eof_count = cdr(ignore_eof); + lino_hist_set_max_len(ls, c_num(cdr(hist_len_var), self)); if (hist1_w && funcall1(pexist_s, hist1)) { -- cgit v1.2.3