~strahinja/sled

1e1633c66c32f8b11029a446b1faec3b57b2a9ed — Страхиња Радић a month ago b1365d2
sled.c(prev_match): Move definition to proper place, (simple_yank): Initialize variable for all conditional branches

Signed-off-by: Страхиња Радић <contact@strahinja.org>
1 files changed, 3 insertions(+), 2 deletions(-)

M sled.c
M sled.c => sled.c +3 -2
@@ 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,