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.
This commit is contained in:
ridiculousfish 2021-12-12 14:26:45 -08:00
parent 76eef0fea9
commit 68ee2ff9f3

View file

@ -276,10 +276,7 @@ maybe_t<int> 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;