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
This commit is contained in:
Benno Schulenberg 2014-05-25 19:47:46 +00:00
parent f5ac8c1ee1
commit 353dd21588
2 changed files with 13 additions and 4 deletions

View File

@ -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> 2014-05-25 Mark Majeres <mark@engine12.com>
* src/chars.c (addstrings): New function, concatenates two allocated * src/chars.c (addstrings): New function, concatenates two allocated
strings, tacking the second onto the first and freeing the second. strings, tacking the second onto the first and freeing the second.

View File

@ -1257,6 +1257,7 @@ const char *flagtostr(int flag)
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
#ifndef DISABLE_NANORC
/* Interpret a function string given in the rc file, and return a /* Interpret a function string given in the rc file, and return a
* shortcut struct, complete with the proper value for execute. */ * shortcut struct, complete with the proper value for execute. */
sc *strtosc(char *input) sc *strtosc(char *input)
@ -1529,8 +1530,7 @@ sc *strtosc(char *input)
return s; return s;
} }
#ifndef DISABLE_NANORC /* Interpret a menu name and return the corresponding menu flag. */
/* Same thing as above but for the menu. */
int strtomenu(char *input) int strtomenu(char *input)
{ {
if (!strcasecmp(input, "all")) if (!strcasecmp(input, "all"))
@ -1553,22 +1553,27 @@ int strtomenu(char *input)
else if (!strcasecmp(input, "externalcmd") || else if (!strcasecmp(input, "externalcmd") ||
!strcasecmp(input, "extcmd")) !strcasecmp(input, "extcmd"))
return MEXTCMD; return MEXTCMD;
#ifndef DISABLE_HELP
else if (!strcasecmp(input, "help")) else if (!strcasecmp(input, "help"))
return MHELP; return MHELP;
#endif
#ifndef DISABLE_SPELLER
else if (!strcasecmp(input, "spell")) else if (!strcasecmp(input, "spell"))
return MSPELL; return MSPELL;
#endif
else if (!strcasecmp(input, "linter")) else if (!strcasecmp(input, "linter"))
return MLINTER; return MLINTER;
#ifndef DISABLE_BROWSER
else if (!strcasecmp(input, "browser")) else if (!strcasecmp(input, "browser"))
return MBROWSER; return MBROWSER;
else if (!strcasecmp(input, "whereisfile")) else if (!strcasecmp(input, "whereisfile"))
return MWHEREISFILE; return MWHEREISFILE;
else if (!strcasecmp(input, "gotodir")) else if (!strcasecmp(input, "gotodir"))
return MGOTODIR; return MGOTODIR;
#endif
return -1; return -1;
} }
#endif #endif /* !DISABLE_NANORC */
#ifdef DEBUG #ifdef DEBUG