Commit eac0446c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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
No related merge requests found
Showing with 12 additions and 2 deletions
+12 -2
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
src/winio.c (display_string, statusbar): Allow toggling the display src/winio.c (display_string, statusbar): Allow toggling the display
of whitespace also when support for nanorc files was not built in, of whitespace also when support for nanorc files was not built in,
because the default values are quite usable. 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 <bensberg@justemail.net> 2015-08-08 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (display_string): For some reason the reallocation done * src/winio.c (display_string): For some reason the reallocation done
......
...@@ -909,8 +909,10 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkw ...@@ -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)", "Read %lu lines (Warning: No write permission)",
(unsigned long)num_lines), (unsigned long)num_lines); (unsigned long)num_lines), (unsigned long)num_lines);
#ifndef NANO_TINY
if (ISSET(MAKE_IT_UNIX)) if (ISSET(MAKE_IT_UNIX))
openfile->fmt = NIX_FILE; openfile->fmt = NIX_FILE;
#endif
} }
/* Open the file (and decide if it exists). If newfie is TRUE, display /* Open the file (and decide if it exists). If newfie is TRUE, display
......
...@@ -954,6 +954,9 @@ void usage(void) ...@@ -954,6 +954,9 @@ void usage(void)
N_("Enable alternate speller")); N_("Enable alternate speller"));
#endif #endif
print_opt("-t", "--tempfile", N_("Auto save on exit, don't prompt")); 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)")); print_opt("-v", "--view", N_("View mode (read-only)"));
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines")); print_opt("-w", "--nowrap", N_("Don't hard-wrap long lines"));
...@@ -2166,7 +2169,6 @@ int main(int argc, char **argv) ...@@ -2166,7 +2169,6 @@ int main(int argc, char **argv)
{"speller", 1, NULL, 's'}, {"speller", 1, NULL, 's'},
#endif #endif
{"tempfile", 0, NULL, 't'}, {"tempfile", 0, NULL, 't'},
{"unix", 0, NULL, 'u'},
{"view", 0, NULL, 'v'}, {"view", 0, NULL, 'v'},
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
{"nowrap", 0, NULL, 'w'}, {"nowrap", 0, NULL, 'w'},
...@@ -2188,6 +2190,7 @@ int main(int argc, char **argv) ...@@ -2188,6 +2190,7 @@ int main(int argc, char **argv)
{"wordbounds", 0, NULL, 'W'}, {"wordbounds", 0, NULL, 'W'},
{"autoindent", 0, NULL, 'i'}, {"autoindent", 0, NULL, 'i'},
{"cut", 0, NULL, 'k'}, {"cut", 0, NULL, 'k'},
{"unix", 0, NULL, 'u'},
{"softwrap", 0, NULL, '$'}, {"softwrap", 0, NULL, '$'},
#endif #endif
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
...@@ -2401,9 +2404,11 @@ int main(int argc, char **argv) ...@@ -2401,9 +2404,11 @@ int main(int argc, char **argv)
case 't': case 't':
SET(TEMP_FILE); SET(TEMP_FILE);
break; break;
#ifndef NANO_TINY
case 'u': case 'u':
SET(MAKE_IT_UNIX); SET(MAKE_IT_UNIX);
break; break;
#endif
case 'v': case 'v':
SET(VIEW_MODE); SET(VIEW_MODE);
break; break;
......
...@@ -82,7 +82,6 @@ static const rcoption rcopts[] = { ...@@ -82,7 +82,6 @@ static const rcoption rcopts[] = {
{"suspend", SUSPEND}, {"suspend", SUSPEND},
{"tabsize", 0}, {"tabsize", 0},
{"tempfile", TEMP_FILE}, {"tempfile", TEMP_FILE},
{"unix", MAKE_IT_UNIX},
{"view", VIEW_MODE}, {"view", VIEW_MODE},
#ifndef NANO_TINY #ifndef NANO_TINY
{"allow_insecure_backup", INSECURE_BACKUP}, {"allow_insecure_backup", INSECURE_BACKUP},
...@@ -101,6 +100,7 @@ static const rcoption rcopts[] = { ...@@ -101,6 +100,7 @@ static const rcoption rcopts[] = {
{"smooth", SMOOTH_SCROLL}, {"smooth", SMOOTH_SCROLL},
{"softwrap", SOFTWRAP}, {"softwrap", SOFTWRAP},
{"tabstospaces", TABS_TO_SPACES}, {"tabstospaces", TABS_TO_SPACES},
{"unix", MAKE_IT_UNIX},
{"whitespace", 0}, {"whitespace", 0},
{"wordbounds", WORD_BOUNDS}, {"wordbounds", WORD_BOUNDS},
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment