fix segfault if we try to copy an empty selection
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3432 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
714c522413
commit
7504714882
|
@ -161,14 +161,15 @@ void do_cut_text(
|
||||||
cut_line();
|
cut_line();
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (copy_text)
|
if (copy_text) {
|
||||||
/* Copy the text in the cutbuffer, starting at its saved end if
|
/* Copy the text in the cutbuffer, starting at its saved end if
|
||||||
* there is one, back into the filestruct. This effectively
|
* there is one, back into the filestruct. This effectively
|
||||||
* uncuts the text we just cut without marking the file as
|
* uncuts the text we just cut without marking the file as
|
||||||
* modified. */
|
* modified. */
|
||||||
copy_from_filestruct((cb_save != NULL) ? cb_save : cutbuffer,
|
if (cutbuffer != NULL)
|
||||||
cutbottom);
|
copy_from_filestruct((cb_save != NULL) ? cb_save :
|
||||||
else
|
cutbuffer, cutbottom);
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
/* Leave the text in the cutbuffer, and mark the file as
|
/* Leave the text in the cutbuffer, and mark the file as
|
||||||
* modified. */
|
* modified. */
|
||||||
|
|
Loading…
Reference in New Issue