tweaks: don't bother overwriting a CR -- decreasing the length is enough
The string of bytes get properly terminated by encode_data(); there is no need to do that earlier.master
parent
56bf29409b
commit
fe94999c1c
|
@ -682,14 +682,14 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable)
|
|||
if (input == '\n') {
|
||||
#ifndef NANO_TINY
|
||||
if (len > 0 && buf[len - 1] == '\r' && !ISSET(NO_CONVERT)) {
|
||||
buf[--len] = '\0';
|
||||
if (num_lines == 0)
|
||||
format = 1;
|
||||
len--;
|
||||
}
|
||||
} else if ((num_lines == 0 || format == 2) && !ISSET(NO_CONVERT) &&
|
||||
len > 0 && buf[len - 1] == '\r') {
|
||||
buf[--len] = '\0';
|
||||
format = 2;
|
||||
len--;
|
||||
#endif
|
||||
} else {
|
||||
/* Store the byte. */
|
||||
|
|
Loading…
Reference in New Issue