From 40e1fd37d7794ae1737b76d969b8498926e4ad62 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 5 Dec 2015 10:16:26 +0000 Subject: [PATCH] Fixing compilation with --enable-tiny --enable-justify. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/text.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 526cb728..e202cb01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2015-12-05 Benno Schulenberg + * src/text.c: Fix compilation with --enable-tiny --enable-justify. + 2015-12-04 Benno Schulenberg * src/proto.h: Avoid a compilation warning. * src/color.c (reset_multis_for_id, reset_multis_before/after): diff --git a/src/text.c b/src/text.c index c16640b3..62271726 100644 --- a/src/text.c +++ b/src/text.c @@ -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; -- 2.39.5