sled

Једноставни уређивач текста
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 1e1633c66c32f8b11029a446b1faec3b57b2a9ed
родитељ b1365d2a14cbc2fdf95fee686eb5b3f4bdccf122
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Wed, 25 May 2022 18:53:18 +0200

sled.c(prev_match): Move definition to proper place, (simple_yank): Initialize variable for all conditional branches

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Msled.c | 5+++--
измењених датотека: 1, додавања: 3(+), брисања: 2(-)

diff --git a/sled.c b/sled.c @@ -1616,6 +1616,7 @@ prev_match(struct DrawState* state) search_len = u32_strlen(state->search); for (size_t row = state->coord.row + 1; row > 0; row--) { + const uint32_t* save_found; current = state->buffer + row - 1; found = current->text; if (!found) @@ -1629,7 +1630,7 @@ prev_match(struct DrawState* state) found += current->length - search_len + 1; prev_match_loop: - const uint32_t* save_found = found; + save_found = found; found = u32_strrstr(current->text, state->search, found); if (found) { @@ -1839,6 +1840,7 @@ simple_yank(struct DrawState* state) } state->paste_count = ser - ssr + 1; + initialize_start = state->paste_size; if (!state->paste_size) { initialize_start = 0; @@ -1848,7 +1850,6 @@ simple_yank(struct DrawState* state) } else if (state->paste_count > state->paste_size) { - initialize_start = state->paste_size; while (state->paste_count > state->paste_size) state->paste_size += ALLOC_DELTA; newbuf = realloc(state->paste,