From a8f44d07f95b019f95977f0d8ed2edbefe2fc5e5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 6 May 1997 19:30:49 +0000 Subject: [PATCH] (getline): Don't miss CRLF pairs when the CR and LF are read in separate blocks. --- lib-src/pop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-src/pop.c b/lib-src/pop.c index 9292998e28..48e9df7b5d 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -1316,7 +1316,9 @@ getline (server) fprintf (stderr, "<<< %s\n", server->buffer); return (server->buffer); } - search_offset += ret; + /* As above, the "- 1" here is to account for the fact that + we may have read a CR without its accompanying LF. */ + search_offset += ret - 1; } } -- 2.20.1