From 5244ecbe9bf5fef017844f2bcfe802ba48b85da1 Mon Sep 17 00:00:00 2001 From: Sidharth Kshatriya Date: Thu, 24 Jun 2021 19:49:54 +0530 Subject: [PATCH] Also deal with variables named kak_quoted_* by using a more generic approach --- src/shell_manager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index ebd6af40..57db1538 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -142,11 +142,11 @@ Vector 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;