changeset 6563:d85bfe89f4b8 HEAD

Don't assert-crash if underlying input stream read only a CR character.
author Timo Sirainen <tss@iki.fi>
date Sat, 20 Oct 2007 19:21:15 +0300
parents 8917cf7fa8ba
children c4fa8b1ee24a
files src/lib/istream-crlf.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/istream-crlf.c	Sat Oct 20 19:17:00 2007 +0300
+++ b/src/lib/istream-crlf.c	Sat Oct 20 19:21:15 2007 +0300
@@ -100,7 +100,10 @@
 	i_stream_skip(cstream->input, i);
 
 	ret = dest - stream->pos;
-	i_assert(ret > 0);
+	if (ret == 0) {
+		i_assert(cstream->last_char == '\r' && size == 1);
+		return i_stream_crlf_read(stream);
+	}
 	stream->pos = dest;
 	return ret;
 }