nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 8db42023bb53e11ccbe3a9727cbe1f3fb247d830
parent 018a8e12cae481342d3efb9fce6d6dc9fa12a799
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 12 Apr 2021 14:50:04 +0200

files: when Mac format has been detected, stay with it

This fixes https://savannah.gnu.org/bugs/?60382.

Bug existed since commit 09b919a6 from three weeks ago.

Diffstat:
Msrc/files.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -699,7 +699,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable) format = DOS_FILE; len--; } - } else if ((num_lines == 0 || format == 2) && + } else if ((num_lines == 0 || format == MAC_FILE) && len > 0 && buf[len - 1] == '\r' && !ISSET(NO_CONVERT)) { format = MAC_FILE; len--;