-
-
Notifications
You must be signed in to change notification settings - Fork 40.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes null-character termination in ucis_add() #22351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test for this?
IMHO the fix reveals that Given:
Should i fix the test (and leave the current behaviour) or should i fix the behaviour:question: |
I think that behaviour might be less than predictable to most users, even if you personally find it useful. It's probably more straightforward to trigger only on the first exact match (which should really be the only exact match). |
Thank you for your contribution! |
@rubienr thanks for your PR. It looks good in principle but there are now falling unit-tests as you have changed the behavior. This has to be fixed in order to merge. Also please add the mentioned example in the description of the pr as a new test. |
Apologies for the long delay. I will try to focus on this PR ASAP: comments, suggestions, failing tests. |
In fact, empty matching match the first thing in array which is weird... |
The
A conditional compilation variable could be added to switch between behaviours |
Unblocked stalebot from doing its thing -- if there's no appetite for fixing unit tests, then there's no need to keep this PR open. |
Thank you for your contribution! |
Thank you for your contribution! |
Description
With
UCIS_ENABLE = yes
andUNICODE_COMMON = yes
when entering a wrong mnemonic, a second attempt with correct mnemonic would not trigger the ucis input.This change:
0
after the last added character inucis_add()
ucis_add()
to not write out of bounds0
onucis_remove_last()
Types of Changes
Issues Fixed or Closed by This PR
Fixes following example:
keymap.c
⌨poopxyz
(wrong mnemonic)⌨poop
(correct mnemonic) would not trigger since the buffer is stillpoopxyz'0''0'...
Checklist
Relates to #21659