nano

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

commit e9c7dfa99221935ffa38b5b9dbf294933e0aa7c0
parent 33eaf3e947c5c7baad889339b8615c7e7d612c66
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  3 May 2024 12:12:09 +0200

minibar: do not falsely report that a new, empty file is in Mac format

The 'openfile->fmt' element gets initialized to 'UNSPECIFIED',
so the code has to take that possibility into account.

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

Bug existed since version 8.0, commit fe4f74f6.

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

diff --git a/src/winio.c b/src/winio.c @@ -2213,7 +2213,7 @@ void minibar(void) size_t count = openfile->filebot->lineno - (openfile->filebot->data[0] == '\0'); number_of_lines = nmalloc(49); - if (openfile->fmt == NIX_FILE) + if (openfile->fmt == NIX_FILE || openfile->fmt == UNSPECIFIED) sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count); else sprintf(number_of_lines, P_(" (%zu line, %s)", " (%zu lines, %s)", count),