summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-06-03 20:57:03 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-06-03 20:57:03 -0700
commite96306e75ac59393ab051ca4a85e12533f64d9d6 (patch)
treee0e7c24b7cb00c24142db2242151720f7fe043f6
parent78c7b4ed0638580f20092cfbc4ca1c5f447427cb (diff)
downloadtxr-e96306e75ac59393ab051ca4a85e12533f64d9d6.tar.gz
txr-e96306e75ac59393ab051ca4a85e12533f64d9d6.tar.bz2
txr-e96306e75ac59393ab051ca4a85e12533f64d9d6.zip
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.
-rw-r--r--parser.c4
1 files changed, 3 insertions, 1 deletions
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)) {