From e4d6bff5ec1a6bf3a3456e26d51e53d85c282ea0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 27 Jun 2019 22:42:12 +1000 Subject: [PATCH] Fix quoting of tuple options Fixes #2990 --- src/option_types.hh | 2 +- test/shell/quoted-range/cmd | 1 + test/shell/quoted-range/in | 1 + test/shell/quoted-range/out | 1 + test/shell/quoted-range/rc | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/shell/quoted-range/cmd create mode 100644 test/shell/quoted-range/in create mode 100644 test/shell/quoted-range/out create mode 100644 test/shell/quoted-range/rc diff --git a/src/option_types.hh b/src/option_types.hh index 5c7b2a9f..c0f138ea 100644 --- a/src/option_types.hh +++ b/src/option_types.hh @@ -174,7 +174,7 @@ constexpr char tuple_separator = '|'; template String option_to_string_impl(Quoting quoting, const std::tuple& opt, std::index_sequence) { - return join(make_array({option_to_string(std::get(opt), quoting)...}), tuple_separator); + return quoter(quoting)(join(make_array({option_to_string(std::get(opt), Quoting::Raw)...}), tuple_separator)); } template diff --git a/test/shell/quoted-range/cmd b/test/shell/quoted-range/cmd new file mode 100644 index 00000000..0a2faf6b --- /dev/null +++ b/test/shell/quoted-range/cmd @@ -0,0 +1 @@ +!printf '%s' "$kak_quoted_opt_my_ranges" diff --git a/test/shell/quoted-range/in b/test/shell/quoted-range/in new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/shell/quoted-range/in @@ -0,0 +1 @@ + diff --git a/test/shell/quoted-range/out b/test/shell/quoted-range/out new file mode 100644 index 00000000..2488b23f --- /dev/null +++ b/test/shell/quoted-range/out @@ -0,0 +1 @@ +1 '1.1,1.1|a b' '1.2,1.2|b c' diff --git a/test/shell/quoted-range/rc b/test/shell/quoted-range/rc new file mode 100644 index 00000000..d88fab4c --- /dev/null +++ b/test/shell/quoted-range/rc @@ -0,0 +1 @@ +declare-option range-specs my_ranges 1 '1.1,1.1|a b' '1.2,1.2|b c'