From acc3ef398c456c9157443200d42f11e4668fc646 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Mar 2024 11:42:10 +0200 Subject: Get rid of extraneous trailing blank lines in auxiliary environment value --- bbot/agent/agent.cxx | 4 ++-- bbot/worker/worker.cxx | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'bbot') diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index 2de1d8b..7d734d3 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -2020,10 +2020,10 @@ start_auxiliary_machines (const vector& ams, // Add the machine name as a header before its environment. // + if (i != 0) envs += '\n'; envs += "# "; envs += tam.name; envs += '\n'; envs += "#\n"; - envs += p.second; - envs += '\n'; + envs += p.second; // Always includes trailing newline. } tm.auxiliary_environment = move (envs); diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 8388d03..5f857b0 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -6060,6 +6060,11 @@ parse_auxiliary_environment (const string& s, const char* comment = nullptr) r.push_back (move (line)); } + // Pop the final blank line comment. + // + if (comment != nullptr && r.back () == comment) + r.pop_back (); + return r; } -- cgit v1.1