From b80d49f0718cf069ee4ba168a02d54055a7a4e83 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 26 Mar 2005 22:49:46 +0000
Subject: [PATCH] make sure that all references to cut-to-end are left out when
 NANO_SMALL is defined

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   | 6 ++++--
 src/cut.c   | 9 ++++-----
 src/nano.c  | 2 +-
 src/proto.h | 2 +-
 src/winio.c | 4 ++++
 5 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95d86bce..bd3b2bdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@ CVS code -
 	- After (re)initializing the terminal, make sure the cursor is
 	  always turned on.  Changes to do_alt_speller(),
 	  handle_sigwinch(), and main(). (DLR)
+	- Make sure that all references to cut-to-end are left out when
+	  NANO_SMALL is defined.  Changes to cut_to_eol(),
+	  do_cut_text(), and do_statusbar_cut_text(). (DLR)
 - chars.c:
   make_mbchar()
 	- Remove unneeded assert. (DLR)
@@ -40,8 +43,7 @@ CVS code -
 	  HAVE_GETOPT_LONG isn't defined. (DLR)
   usage()
 	- Fix erroneous #ifdef that resulted in the -d/--rebinddelete
-	  and -k/--cut options' not being printed when NANO_SMALL was
-	  defined. (DLR)
+	  option's not being printed when NANO_SMALL was defined. (DLR)
   find_paragraph()
 	- Fix problem where a search for the next paragraph would skip
 	  over certain cases of one-line paragraphs. (DLR)
diff --git a/src/cut.c b/src/cut.c
index 3e7ecb3a..6200a88d 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -63,7 +63,6 @@ void cut_marked(void)
     move_to_filestruct(&cutbuffer, &cutbottom, top, top_x, bot, bot_x);
     placewewant = xplustabs();
 }
-#endif
 
 /* If we're not at the end of the current line, move all the text from
  * the current cursor position to the end of the current line,
@@ -93,6 +92,7 @@ void cut_to_eol(void)
 	placewewant = xplustabs();
     }
 }
+#endif /* !NANO_SMALL */
 
 /* Move text from the current filestruct into the cutbuffer. */
 void do_cut_text(void)
@@ -122,13 +122,12 @@ void do_cut_text(void)
 	 * turn the mark off. */
 	cut_marked();
 	UNSET(MARK_ISSET);
-    } else
-#endif
-    if (ISSET(CUT_TO_END))
+    } else if (ISSET(CUT_TO_END))
 	/* Otherwise, if the CUT_TO_END flag is set, move all text up to
 	 * the end of the line into the cutbuffer. */
 	cut_to_eol();
     else
+#endif
 	/* Otherwise, move the entire line into the cutbuffer. */
 	cut_line();
 
@@ -158,7 +157,7 @@ void do_cut_till_end(void)
     dump_buffer(cutbuffer);
 #endif
 }
-#endif
+#endif /* !NANO_SMALL */
 
 /* Copy text from the cutbuffer into the current filestruct. */
 void do_uncut_text(void)
diff --git a/src/nano.c b/src/nano.c
index ecc405a6..dce8e9ef 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1005,8 +1005,8 @@ void usage(void)
     print1opt("-d", "--rebinddelete", N_("Fix Backspace/Delete confusion problem"));
 #ifndef NANO_SMALL
     print1opt("-i", "--autoindent", N_("Automatically indent new lines"));
-#endif
     print1opt("-k", "--cut", N_("Cut from cursor to end of line"));
+#endif
     print1opt("-l", "--nofollow", N_("Don't follow symbolic links, overwrite"));
 #ifndef DISABLE_MOUSE
     print1opt("-m", "--mouse", N_("Enable mouse"));
diff --git a/src/proto.h b/src/proto.h
index 8398fe29..a61bfc76 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -223,8 +223,8 @@ void cutbuffer_reset(void);
 void cut_line(void);
 #ifndef NANO_SMALL
 void cut_marked(void);
-#endif
 void cut_to_eol(void);
+#endif
 void do_cut_text(void);
 #ifndef NANO_SMALL
 void do_cut_till_end(void);
diff --git a/src/winio.c b/src/winio.c
index 10ddfbf1..11cc87d1 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1887,12 +1887,16 @@ void do_statusbar_cut_text(void)
 {
     assert(answer != NULL);
 
+#ifndef NANO_SMALL
     if (ISSET(CUT_TO_END))
 	null_at(&answer, statusbar_x);
     else {
+#endif
 	null_at(&answer, 0);
 	statusbar_x = 0;
+#ifndef NANO_SMALL
     }
+#endif
 }
 
 #ifndef NANO_SMALL
-- 
GitLab