summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-15 20:03:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-15 20:03:56 -0700
commitf200086eff39c729cbdbb5dbdcb97b134f3fdd0d (patch)
tree66d1853e84c8ed28a6fff176eb401db8cb6d5372 /parser.c
parent50b5651649f71c7f1e4c480504b61cea04d8f789 (diff)
downloadtxr-f200086eff39c729cbdbb5dbdcb97b134f3fdd0d.tar.gz
txr-f200086eff39c729cbdbb5dbdcb97b134f3fdd0d.tar.bz2
txr-f200086eff39c729cbdbb5dbdcb97b134f3fdd0d.zip
Close source files after parsing.
* eval.c (sys_load): close stream in all cases. * match.c (v_load): Likewise. * parser.c (load_rcfile): Close stream in unwind block, if open. * txr.c (txr_main): Close stream after parsing in all cases. If stream is std_input, or a string stream, close_stream does nothing.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 012b4da1..865dee7b 100644
--- a/parser.c
+++ b/parser.c
@@ -426,7 +426,10 @@ static void load_rcfile(val name)
format(std_output, lit("** details: ~a\n"), car(va), nao);
}
- uw_unwind;
+ uw_unwind {
+ if (stream)
+ close_stream(stream, nil);
+ }
uw_catch_end;
}