mirror of git://git.sv.gnu.org/nano.git
formatter: force the mark off, to not crash by accessing empty cutbuffer
More generally, after invoking the formatter, the entire buffer should
be cut (to be replaced with the reformatted text) and not just the part
before the mark, because then everything after it would be duplicated.
This fixes https://savannah.gnu.org/bugs/?58879.
Bug existed since version 4.9, commit 19517fc5
.
This commit is contained in:
parent
4940b02ae0
commit
6fa81ca5b8
|
@ -2922,6 +2922,8 @@ void do_formatter(void)
|
|||
return;
|
||||
}
|
||||
|
||||
openfile->mark = NULL;
|
||||
|
||||
temp_name = safe_tempfile(&stream);
|
||||
|
||||
if (temp_name != NULL)
|
||||
|
|
Loading…
Reference in New Issue