From 826977eb1b72ed67f6f35d7fd735c839e41ae947 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 20 Mar 2018 05:35:37 +1100 Subject: [PATCH] Fix remove of highlighters with trailing / in their name Fixes #1914 --- src/commands.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index 0f986498..43868c19 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -742,6 +742,9 @@ const CommandDesc remove_highlighter_cmd = { [](const ParametersParser& parser, Context& context, const ShellContext&) { StringView path = parser[0]; + if (not path.empty() and path.back() == '/') // ignore trailing / + path = path.substr(0_byte, path.length() - 1_byte); + auto rev_path = path | reverse(); auto sep_it = find(rev_path, '/'); if (sep_it == rev_path.end())