From 0f4f9f6d91f1f842f8cf6691cfcd39d34234adcd Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 28 Jun 2008 22:03:43 +0000 Subject: Make iconv-based filtering produce correct output when encountering encoding errors. Fix inputstream_peek_slow to flag OOD when the buffer fill routine produces no new data. svn path=/trunk/libparserutils/; revision=4474 --- src/input/inputstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/input/inputstream.c') diff --git a/src/input/inputstream.c b/src/input/inputstream.c index 9cbcdd2..5631331 100644 --- a/src/input/inputstream.c +++ b/src/input/inputstream.c @@ -235,7 +235,8 @@ uintptr_t parserutils_inputstream_peek_slow(parserutils_inputstream *stream, /* Refill utf8 buffer from raw buffer */ error = parserutils_inputstream_refill_buffer(s); - if (error != PARSERUTILS_OK) + if (error != PARSERUTILS_OK || + s->public.cursor + offset == s->public.utf8->length) return PARSERUTILS_INPUTSTREAM_OOD; /* Now try the read */ -- cgit v1.2.3