summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSidharth Kshatriya <sid.kshatriya@gmail.com>2021-06-24 19:49:54 +0530
committerSidharth Kshatriya <sid.kshatriya@gmail.com>2021-06-24 19:49:54 +0530
commit5244ecbe9bf5fef017844f2bcfe802ba48b85da1 (patch)
tree534bb75584f24cb33f69380859c3565195c27e4b /src
parent0ca81e7cecaee96ba3f7fb7f7fc4011699431bf8 (diff)
Also deal with variables named kak_quoted_* by using a more generic approach
Diffstat (limited to 'src')
-rw-r--r--src/shell_manager.cc6
1 files 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<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;