diff options
| author | Maxime Coste <mawww@kakoune.org> | 2016-12-17 06:06:07 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2016-12-17 06:06:07 +0000 |
| commit | cf10f3f0a049e3c6a79d45448a0ef06df053ade3 (patch) | |
| tree | a3cbc449979bdd1438661639b1f9ea17117bc7ef /src/string.hh | |
| parent | 2bdd361948c1dee3f9b74ee6d439fdd9dba1b32e (diff) | |
Fix join, we dont have a StringView from char array constructor
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.hh b/src/string.hh index 00a20adc..28c193b8 100644 --- a/src/string.hh +++ b/src/string.hh @@ -330,13 +330,13 @@ String replace(StringView str, StringView substr, StringView replacement); template<typename Container> String join(const Container& container, char joiner, bool esc_joiner = true) { - const char to_escape[] = { joiner, '\\' }; + const char to_escape[2] = { joiner, '\\' }; String res; for (const auto& str : container) { if (not res.empty()) res += joiner; - res += esc_joiner ? escape(str, to_escape, '\\') : str; + res += esc_joiner ? escape(str, {to_escape, 2}, '\\') : str; } return res; } |
