From aadc67dfdb47f28bb8d1fa5e0fe0f52e2a8c51bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Thu, 15 Jul 2010 12:06:04 +0100 Subject: [PATCH] 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. --- src/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.47.3