Fixing compilation with --enable-tiny --enable-justify.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-12-05 10:16:26 +00:00
parent f2da466388
commit 40e1fd37d7
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,6 @@
2015-12-05 Benno Schulenberg <bensberg@justemail.net>
* src/text.c: Fix compilation with --enable-tiny --enable-justify.
2015-12-04 Benno Schulenberg <bensberg@justemail.net>
* src/proto.h: Avoid a compilation warning.
* src/color.c (reset_multis_for_id, reset_multis_before/after):

View File

@ -2270,7 +2270,11 @@ void do_justify(bool full_justify)
func = func_from_key(&kbinput);
if (func == do_uncut_text || func == do_undo) {
if (func == do_uncut_text
#ifndef NANO_TINY
|| func == do_undo
#endif
) {
/* Splice the justify buffer back into the file, but only if we
* actually justified something. */
if (first_par_line != NULL) {
@ -2324,11 +2328,12 @@ void do_justify(bool full_justify)
/* Put the keystroke back into the queue. */
unget_kbinput(kbinput, meta_key, func_key);
#ifndef NANO_TINY
/* Throw away the entire undo stack, to prevent a crash when
* the user tries to undo something in the justified text. */
discard_until(NULL);
openfile->current_undo = NULL;
#endif
/* Blow away the text in the justify buffer. */
free_filestruct(jusbuffer);
jusbuffer = NULL;