tweaks: adjust and improve one comment, and frob another

This commit is contained in:
Benno Schulenberg 2021-04-12 15:14:05 +02:00
parent 8db42023bb
commit eb7181b35e

View File

@ -688,10 +688,10 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
if (control_C_was_pressed) if (control_C_was_pressed)
break; break;
/* When the byte before the current one is a CR and we're doing /* When the byte before the current one is a CR and automatic format
* format conversion, then strip this CR when it's before a LF * conversion has not been switched off, then strip this CR when it's
* OR when the file is in Mac format. Also, when still on the * before a LF OR when the file is in Mac format. Also, when this is
* first line, set the format to either DOS (1) or Mac (2). */ * the first line break, make a note of the format. */
if (input == '\n') { if (input == '\n') {
#ifndef NANO_TINY #ifndef NANO_TINY
if (len > 0 && buf[len - 1] == '\r' && !ISSET(NO_CONVERT)) { if (len > 0 && buf[len - 1] == '\r' && !ISSET(NO_CONVERT)) {
@ -768,7 +768,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
if (fd > 0 && !undoable && !ISSET(VIEW_MODE)) if (fd > 0 && !undoable && !ISSET(VIEW_MODE))
writable = (access(filename, W_OK) == 0); writable = (access(filename, W_OK) == 0);
/* If the file ended with newline, or it was entirely empty, make the /* If the file ended with a newline, or it was entirely empty, make the
* last line blank. Otherwise, put the last read data in. */ * last line blank. Otherwise, put the last read data in. */
if (len == 0) if (len == 0)
bottomline->data = copy_of(""); bottomline->data = copy_of("");