commit 353dd215888ebbec69ad9b6fdc47ae176c4c6075
parent f5ac8c1ee1422c4a61b4173ec40b9c784218b542
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 25 May 2014 19:47:46 +0000
Cutting down on the size of tiny nano.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4909 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-25 Benno Schulenberg <bensberg@justemail.net>
+ * src/global.c: Cut down on the size of tiny nano, by not compiling
+ the function strtosc() when --disable-nanorc is given or implied.
+
2014-05-25 Mark Majeres <mark@engine12.com>
* src/chars.c (addstrings): New function, concatenates two allocated
strings, tacking the second onto the first and freeing the second.
diff --git a/src/global.c b/src/global.c
@@ -1257,6 +1257,7 @@ const char *flagtostr(int flag)
}
#endif /* !NANO_TINY */
+#ifndef DISABLE_NANORC
/* Interpret a function string given in the rc file, and return a
* shortcut struct, complete with the proper value for execute. */
sc *strtosc(char *input)
@@ -1529,8 +1530,7 @@ sc *strtosc(char *input)
return s;
}
-#ifndef DISABLE_NANORC
-/* Same thing as above but for the menu. */
+/* Interpret a menu name and return the corresponding menu flag. */
int strtomenu(char *input)
{
if (!strcasecmp(input, "all"))
@@ -1553,22 +1553,27 @@ int strtomenu(char *input)
else if (!strcasecmp(input, "externalcmd") ||
!strcasecmp(input, "extcmd"))
return MEXTCMD;
+#ifndef DISABLE_HELP
else if (!strcasecmp(input, "help"))
return MHELP;
+#endif
+#ifndef DISABLE_SPELLER
else if (!strcasecmp(input, "spell"))
return MSPELL;
+#endif
else if (!strcasecmp(input, "linter"))
return MLINTER;
+#ifndef DISABLE_BROWSER
else if (!strcasecmp(input, "browser"))
return MBROWSER;
else if (!strcasecmp(input, "whereisfile"))
return MWHEREISFILE;
else if (!strcasecmp(input, "gotodir"))
return MGOTODIR;
-
+#endif
return -1;
}
-#endif
+#endif /* !DISABLE_NANORC */
#ifdef DEBUG