mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-07-25 18:19:00 +02:00
sort: fix a bug when sorting unterminated lines
* src/sort.c (fillbuf): The previous commit incorrectly terminated the buffer when the last line of input didn't contain a terminating character.
This commit is contained in:
+1
-1
@@ -1743,7 +1743,7 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file)
|
||||
if (buf->buf == ptrlim)
|
||||
return false;
|
||||
if (ptrlim[-1] != eol)
|
||||
*ptrlim++ = '\0';
|
||||
*ptrlim++ = eol;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user