From fa79f1296a8f8ea0e0725da382433c88d1095907 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 17 Apr 2023 14:56:58 +0200 Subject: [PATCH] Main: Fix extra newline on empty input in readline --- src/step9_try.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/step9_try.cpp b/src/step9_try.cpp index 20fbb4f..c15b9a6 100644 --- a/src/step9_try.cpp +++ b/src/step9_try.cpp @@ -155,7 +155,10 @@ auto main(int argc, char* argv[]) -> int if (pretty_print) { print("\033[0m"); } - print("{}\n", rep(input, blaze::s_outer_env)); + std::string output = rep(input, blaze::s_outer_env); + if (output.length() > 0) { + print("{}\n", output); + } } if (pretty_print) {