Commit 33ac7b91 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

- files.c:read_file() - If the file we're loading has already been detected as...

- files.c:read_file() - If the file we're loading has already been detected as a DOS or Mac formatted file, don't turn on NOCONVERT if we find binary chars in it.  This is because if it's detected as DOS/Mac format, at least one line has already been converted so setting NOCONVERT (which is supposed to signal that none of the file should be converted) makes no sense. (DLR)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1473 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 13 additions and 3 deletions
+13 -3
CVS code
- General:
- Translation updates (see po/ChangeLog for details).
- files.c:
read_file()
- If the file we're loading has already been detected as a DOS
or Mac formatted file, don't turn on NOCONVERT if we find
binary chars in it. This is because if it's detected as
DOS/Mac format, at least one line has already been converted,
so setting NOCONVERT (which is supposed to signal that none
of the file should be converted) makes no sense. (DLR)
- nanorc.5:
- Fix formatting error and update copyright year (Jordi).
- Several enhancements (David Benbennick).
......
......@@ -185,9 +185,11 @@ int read_file(FILE *f, const char *filename, int quiet)
input = (char)input_int;
#ifndef NANO_SMALL
/* If the file has binary chars in it, don't stupidly
assume it's a DOS or Mac formatted file! */
if (!ISSET(NO_CONVERT) && is_cntrl_char((int)input) != 0
&& input != '\t' && input != '\r' && input != '\n')
assume it's a DOS or Mac formatted file if it hasn't been
detected as one already! */
if (fileformat == 0 && !ISSET(NO_CONVERT)
&& is_cntrl_char((int)input) != 0 && input != '\t'
&& input != '\r' && input != '\n')
SET(NO_CONVERT);
#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