From: Pádraig Brady Date: Thu, 15 Jul 2010 11:06:04 +0000 (+0100) Subject: sort: fix a bug when sorting unterminated lines X-Git-Tag: v8.6~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aadc67dfdb47f28bb8d1fa5e0fe0f52e2a8c51bf;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/sort.c b/src/sort.c index 45cb78f0af..7d318788c8 100644 --- a/src/sort.c +++ b/src/sort.c @@ -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; } }