From eac0446c86bdad5376e6620718ce7cac4fc16d2a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 9 Aug 2015 16:31:01 +0000 Subject: [PATCH] Fixing compilation with --enable-tiny: file formats don't exist then. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5349 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/files.c | 2 ++ src/nano.c | 7 ++++++- src/rcfile.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81c2d304..47b22240 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ src/winio.c (display_string, statusbar): Allow toggling the display of whitespace also when support for nanorc files was not built in, because the default values are quite usable. + * src/files.c (read_file), src/rcfile.c, src/nano.c (main, usage): + Fix compilation with --enable-tiny; file formats are not available + then, so option --unix has no place; also add its description. 2015-08-08 Benno Schulenberg * src/winio.c (display_string): For some reason the reallocation done diff --git a/src/files.c b/src/files.c index 2c929c04..30721d22 100644 --- a/src/files.c +++ b/src/files.c @@ -909,8 +909,10 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkw "Read %lu lines (Warning: No write permission)", (unsigned long)num_lines), (unsigned long)num_lines); +#ifndef NANO_TINY if (ISSET(MAKE_IT_UNIX)) openfile->fmt = NIX_FILE; +#endif } /* Open the file (and decide if it exists). If newfie is TRUE, display diff --git a/src/nano.c b/src/nano.c index 6a35faca..c376aaa5 100644 --- a/src/nano.c +++ b/src/nano.c @@ -954,6 +954,9 @@ void usage(void) N_("Enable alternate speller")); #endif print_opt("-t", "--tempfile", N_("Auto save on exit, don't prompt")); +#ifndef NANO_TINY + print_opt("-u", "--unix", N_("Save a file by default in Unix format")); +#endif print_opt("-v", "--view", N_("View mode (read-only)")); #ifndef DISABLE_WRAPPING print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines")); @@ -2166,7 +2169,6 @@ int main(int argc, char **argv) {"speller", 1, NULL, 's'}, #endif {"tempfile", 0, NULL, 't'}, - {"unix", 0, NULL, 'u'}, {"view", 0, NULL, 'v'}, #ifndef DISABLE_WRAPPING {"nowrap", 0, NULL, 'w'}, @@ -2188,6 +2190,7 @@ int main(int argc, char **argv) {"wordbounds", 0, NULL, 'W'}, {"autoindent", 0, NULL, 'i'}, {"cut", 0, NULL, 'k'}, + {"unix", 0, NULL, 'u'}, {"softwrap", 0, NULL, '$'}, #endif {NULL, 0, NULL, 0} @@ -2401,9 +2404,11 @@ int main(int argc, char **argv) case 't': SET(TEMP_FILE); break; +#ifndef NANO_TINY case 'u': SET(MAKE_IT_UNIX); break; +#endif case 'v': SET(VIEW_MODE); break; diff --git a/src/rcfile.c b/src/rcfile.c index 12da051c..52a1b000 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -82,7 +82,6 @@ static const rcoption rcopts[] = { {"suspend", SUSPEND}, {"tabsize", 0}, {"tempfile", TEMP_FILE}, - {"unix", MAKE_IT_UNIX}, {"view", VIEW_MODE}, #ifndef NANO_TINY {"allow_insecure_backup", INSECURE_BACKUP}, @@ -101,6 +100,7 @@ static const rcoption rcopts[] = { {"smooth", SMOOTH_SCROLL}, {"softwrap", SOFTWRAP}, {"tabstospaces", TABS_TO_SPACES}, + {"unix", MAKE_IT_UNIX}, {"whitespace", 0}, {"wordbounds", WORD_BOUNDS}, #endif -- 2.39.5