From 9f34c72b217ea548b2da345cf21f76dd46080020 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 10 Sep 2016 20:45:04 +0200 Subject: [PATCH] better repl output --- tools/repl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/repl.cc b/tools/repl.cc index 32213093..d196c14b 100644 --- a/tools/repl.cc +++ b/tools/repl.cc @@ -217,8 +217,10 @@ static bool do_call(CsState &cs, ostd::ConstCharRange line, bool file = false) { return true; } cs.get_out().writeln(col.empty() ? "stdin: " : "stdin:", err); - cscript::util::print_stack(cs.get_out().iter(), st); - cs.get_out().write('\n'); + if (st.get()) { + cscript::util::print_stack(cs.get_out().iter(), st); + cs.get_out().write('\n'); + } return false; } signal(SIGINT, SIG_DFL);