diff --git a/ChangeLog b/ChangeLog index 13adb3e78566747cea118ad1edb3f80219e926f8..ec32a0fc5a769b9c1ed19a3ad71a7f70c4259f3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/files.c b/files.c index bce6681051c14563631f0f045863a15ecf7d3b31..12ae08ce51c55c2479f00d62518782168dcb35d0 100644 --- a/files.c +++ b/files.c @@ -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