1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-24 07:53:41 +03:00

Also deal with variables named kak_quoted_* by using a more generic approach

This commit is contained in:
Sidharth Kshatriya 2021-06-24 19:49:54 +05:30
parent 0ca81e7cec
commit 5244ecbe9b

View File

@ -142,11 +142,11 @@ Vector<String> generate_env(StringView cmdline, const Context& context, const Sh
for (auto&& match : RegexIterator{cmdline.begin(), cmdline.end(), re})
{
StringView name{match[2].first, match[2].second};
StringView shell_name{match[0].first, match[0].second};
auto match_name = [&](const String& s) {
// 4_byte because of the initial `kak_` prefix
return s.substr(4_byte, name.length()) == name and
s.substr(4_byte + name.length(), 1_byte) == "=";
return s.substr(0_byte, shell_name.length()) == shell_name and
s.substr(0_byte + shell_name.length(), 1_byte) == "=";
};
if (any_of(env, match_name))
continue;