mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ops.c: do_join expects count
of 2 or greater #6855
test_normal.vim fails if we assert >= 2, so we only check >= 1. That at least avoids invalid pointers. TEST_FILE=test_normal.res make oldtest
This commit is contained in:
parent
8ba484ab69
commit
0aba4d825a
@ -3608,6 +3608,7 @@ int do_join(size_t count,
|
|||||||
int remove_comments = (use_formatoptions == TRUE)
|
int remove_comments = (use_formatoptions == TRUE)
|
||||||
&& has_format_option(FO_REMOVE_COMS);
|
&& has_format_option(FO_REMOVE_COMS);
|
||||||
bool prev_was_comment = false;
|
bool prev_was_comment = false;
|
||||||
|
assert(count >= 1);
|
||||||
|
|
||||||
if (save_undo && u_save(curwin->w_cursor.lnum - 1,
|
if (save_undo && u_save(curwin->w_cursor.lnum - 1,
|
||||||
curwin->w_cursor.lnum + (linenr_T)count) == FAIL) {
|
curwin->w_cursor.lnum + (linenr_T)count) == FAIL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user