mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-18 03:41:16 -03:00
Report errors on invalid replacements in string replace
If the replacement in `string replace` is invalid, prior to this fix we would enter into an infinite loop trying to parse it. Instead report errors correctly. Fixes #3381
This commit is contained in:
@@ -4465,7 +4465,7 @@ static void test_string() {
|
||||
{{L"string", L"trim", L"-c", L"\\/", L"a/"}, STATUS_CMD_OK, L"a\n"},
|
||||
{{L"string", L"trim", L"-c", L"\\/", L"\\a/"}, STATUS_CMD_OK, L"a\n"},
|
||||
{{L"string", L"trim", L"-c", L"", L".a."}, STATUS_CMD_ERROR, L".a.\n"}};
|
||||
|
||||
|
||||
for (const auto &t : string_tests) {
|
||||
run_one_string_test(t.argv, t.expected_rc, t.expected_out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user