From 7cdeb3d7f70790b70ff5a1ecafeaa8d4e6e69c76 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 17 Jan 2015 22:55:48 +0000 Subject: simplify echo code, avoid trailing spaces --- src/string.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string.hh') diff --git a/src/string.hh b/src/string.hh index 54a8b900..62cbe5cc 100644 --- a/src/string.hh +++ b/src/string.hh @@ -242,14 +242,14 @@ String escape(StringView str, StringView characters, char escape); String unescape(StringView str, StringView characters, char escape); template -String join(const Container& container, char joiner) +String join(const Container& container, char joiner, bool esc_joiner = true) { String res; for (const auto& str : container) { if (not res.empty()) res += joiner; - res += escape(str, joiner, '\\'); + res += esc_joiner ? escape(str, joiner, '\\') : str; } return res; } -- cgit v1.2.3