чување 3e2d222282059a725b8db677eaa1b242f71d4c65
родитељ 1cf4a51ad31ccaaca7169bcb838c4b0b31143fc6
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 15 Jun 2022 22:22:28 +0200
sled.c(handle_key_event): Fix bug with numerical input on musl
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 2, додавања: 4(+), брисања: 6(-)
diff --git a/TODO b/TODO
@@ -10,7 +10,7 @@
(wq would be assumed.)
- Con: this would overlap with sed(1), with far less actual features.
- < > Investigate C-L <num> in musl-lfs (temporary bug?)
+ <x> Investigate C-L <num> in musl-lfs (temporary bug?)
[~] Code optimization (struct coord...)
diff --git a/sled.c b/sled.c
@@ -266,9 +266,7 @@ handle_key_event(struct tb_event* ev, struct DrawState* state)
if (ev->ch)
{
if ((IN(state->mode, M_INPUT_NUM)
- && u32_strchr(
- (const uint32_t*)"0123456789",
- ev->ch))
+ && strchr("0123456789", (const char)ev->ch))
|| !IN(state->mode, M_INPUT_NUM))
input_insert_char(state, ev->ch);
else
@@ -1631,7 +1629,7 @@ prev_match(struct DrawState* state)
prev_match_loop:
save_found = found;
- found = u32_strrstr(current->text, state->search, found);
+ found = u32_strrstr(current->text, state->search, found);
if (found)
{
idelta = found - (const uint32_t*)current->text;
@@ -1840,7 +1838,7 @@ simple_yank(struct DrawState* state)
}
state->paste_count = ser - ssr + 1;
- initialize_start = state->paste_size;
+ initialize_start = state->paste_size;
if (!state->paste_size)
{
while (state->paste_count > state->paste_size)