From 1b91a2a7618f775af863b18d68b88c022bf94543 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 8 Oct 2021 17:45:49 +0200 Subject: [PATCH] Do not output compilation results that are made of whitespace characters --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1028654..ca5bd44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,7 +71,11 @@ int main(int argc, char* argv[]) { const auto&& result = currentFuture.get(); const bool is_exception = result.second.has_value(); if (not is_exception) { - if (printResult) cout << result.first << '\n'; + if (printResult && !(result.first.empty() || all_of(result.first.begin(), result.first.end(), [](const char& character){ + return isspace(character); + }))) { + cout << result.first << '\n'; + } } else { cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what() << '\n'; }