Fix prefix/suffix icase comparisons

As reported on Gitter, running "echo İ" makes history autosuggestion
for "echo i" crash.  This is because history search correctly
returns the former, but string_prefixes_string_case_insensitive("i",
"İ") incorrectly returns false.  This is because the prefix check
is implemented by trimming the rhs to the length of the prefix and
checking if the result is equal to the prefix.  This is wrong because
the prefix computation should operate on the canonical lowercase
version, because that's what history search uses.
This commit is contained in:
Johannes Altmanninger
2025-12-27 08:06:41 +01:00
parent a8ded9cb0d
commit 30942e16dc
4 changed files with 75 additions and 27 deletions

View File

@@ -45,3 +45,8 @@ isolated-tmux send-keys C-l 'echo ('
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: prompt {{\d+}}> echo (echo)
isolated-tmux send-keys C-u 'echo İ___' Enter C-l 'echo i'
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: prompt {{\d+}}> echo İ___