From 68ee2ff9f389423d76f11e9da96bb6248bb6e635 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 12 Dec 2021 14:26:45 -0800 Subject: [PATCH] Bravely stop removing quotes in builtin history delete The builtin history delete call has some code that removes a leading and trailing quote from its arguments. This code dates back to ec34f2527a, when the builtin was introduced. It seems wrong and tests pass without it. Let's bravely remove it. --- src/builtins/history.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/builtins/history.cpp b/src/builtins/history.cpp index e3648b4bf..0bd0acda5 100644 --- a/src/builtins/history.cpp +++ b/src/builtins/history.cpp @@ -276,10 +276,7 @@ maybe_t builtin_history(parser_t &parser, io_streams_t &streams, const wcha status = STATUS_INVALID_ARGS; break; } - for (wcstring delete_string : args) { - if (delete_string[0] == '"' && delete_string[delete_string.length() - 1] == '"') { - delete_string = delete_string.substr(1, delete_string.length() - 2); - } + for (const wcstring &delete_string : args) { history->remove(delete_string); } break;