diff --git a/ChangeLog b/ChangeLog
index 526cb7287ceb29c67701bf9afde2c2f1fe86d3a7..e202cb015ed5e036745aab75f772c5c6512148d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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):
diff --git a/src/text.c b/src/text.c
index c16640b3f79debbb9d4815d463107fca830ccb30..622717268d6edc22c4e19d836283100f0f6f22bf 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;