From 06aca1cc9e21ef2c21d68920524d517bf372098d Mon Sep 17 00:00:00 2001
From: Rocco Corsi <rocco.corsi@sympatico.ca>
Date: Thu, 11 Jan 2001 05:30:31 +0000
Subject: [PATCH] Rolled back DISABLE_TABCOMP and NANO_SMALL changes from
 earlier today

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@469 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog |  4 ++++
 files.c   |  8 ++++----
 nano.h    | 25 +++++++++++++++++++++++++
 utils.c   |  2 +-
 winio.c   |  4 ++--
 5 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6c733c33..7c1f24c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ General
 	- Changed #ifdefs to check for both DISABLE_TABCOMP and
 	  NANO_SMALL, makes tiny option leave out tab completion, which
 	  shoudl be left out in that circumstance.  Saves at least 5k.
+	- Previous change to #ifdefs DISABLE_TABCOMP and NANO_SMALL rolled
+	  back.
+	- Changed nano.h to automatically define 5 DISABLE varibles when
+	  NANO_SMALL (enable-tiny) is requested at configure.
 - configure.in:
 	- Fix for _use_keypad check breaking slang support (Christian
 	  Weisgerber).
diff --git a/files.c b/files.c
index 64eb8bd2..4e0316c1 100644
--- a/files.c
+++ b/files.c
@@ -265,7 +265,7 @@ int do_insertfile(void)
 	fprintf(stderr, "filename is %s", answer);
 #endif
 
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
 	realname = real_dir_from_tilde(answer);
 #else
 	realname = mallocstrcpy(realname, answer);
@@ -276,7 +276,7 @@ int do_insertfile(void)
 	    
 	    char *tmp = do_browse_from(realname);
 
-#if defined(DISABLE_TABCOMP)
+#ifdef DISABLE_TABCOMP
 	    realname = NULL;
 #endif
 	    if 	(tmp != NULL)
@@ -342,7 +342,7 @@ int write_file(char *name, int tmp)
     if (buf != NULL)
 	free(buf);
 
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
     realname = real_dir_from_tilde(name);
 #else
     realname = mallocstrcpy(realname, name);
@@ -575,7 +575,7 @@ int do_writeout_void(void)
     return do_writeout(filename, 0);
 }
 
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
 static char **homedirs;
 
 /* Return a malloc()ed string containing the actual directory, used
diff --git a/nano.h b/nano.h
index 43e1b813..cd171d16 100644
--- a/nano.h
+++ b/nano.h
@@ -30,6 +30,31 @@
 #ifndef NANO_H
 #define NANO_H 1
 
+/* Define this to make the nano executable as small as possible */
+#ifdef NANO_SMALL
+
+ #ifndef DISABLE_TABCOMP
+  #define DISABLE_TABCOMP 1
+ #endif
+
+ #ifndef DISABLE_JUSTIFY
+  #define DISABLE_JUSTIFY 1
+ #endif
+
+ #ifndef DISABLE_SPELLER
+  #define DISABLE_SPELLER 1
+ #endif
+
+ #ifndef DISABLE_HELP
+  #define DISABLE_HELP 1
+ #endif
+
+ #ifndef DISABLE_BROWSER
+  #define DISABLE_BROWSER 1
+ #endif
+
+#endif /* NANO_SMALL */
+
 /* Macros for the flags int... */
 #define SET(bit) flags |= bit
 #define UNSET(bit) flags &= ~bit
diff --git a/utils.c b/utils.c
index 2c0e7485..a1396419 100644
--- a/utils.c
+++ b/utils.c
@@ -159,7 +159,7 @@ void new_magicline(void)
     totsize++;
 }
 
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
 /*
  * Routine to see if a text string is matched by a wildcard pattern.
  * Returns TRUE if the text is matched, or FALSE if it is not matched
diff --git a/winio.c b/winio.c
index e496e1a2..e10d5cb4 100644
--- a/winio.c
+++ b/winio.c
@@ -250,7 +250,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
     int kbinput = 0, j = 0, x = 0, xend;
     int x_left = 0, inputlen, tabbed = 0;
     char *inputbuf;
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
     int shift = 0;
 #endif
     
@@ -346,7 +346,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
 		x--;
 	    nanoget_repaint(buf, inputbuf, x);
 	    break;
-#if !defined(DISABLE_TABCOMP) && !defined(NANO_SMALL)
+#ifndef DISABLE_TABCOMP
 	case NANO_CONTROL_I:
 	    if (allowtabs) {
 		shift = 0;
-- 
GitLab