From 698c2c6b165e1bc1b57b972f6a7dcd4ca1129600 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 5 Nov 2018 16:38:15 -0800 Subject: load: tolerate hash bang files. * eval.c (load): Consume the first line of the input file if it starts with hash bang. --- eval.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eval.c b/eval.c index 05c07ce8..1555956d 100644 --- a/eval.c +++ b/eval.c @@ -4241,6 +4241,9 @@ val load(val target) open_txr_file(path, &txr_lisp_p, &name, &stream); + if (!match_str(or2(get_line(stream), lit("")), lit("#!"), nil)) + seek_stream(stream, zero, from_start_k); + uw_simple_catch_begin; dyn_env = make_env(nil, nil, dyn_env); -- cgit v1.2.3