- 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
master
Chris Allegretta 2003-02-16 03:13:47 +00:00
parent 1aa8541c5c
commit 33ac7b9181
2 changed files with 13 additions and 3 deletions

View File

@ -1,6 +1,14 @@
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).

View File

@ -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