From 3443321459caa09512ef309baf26cf4fc41f084c Mon Sep 17 00:00:00 2001 From: iska Date: Sat, 28 Nov 2015 21:08:39 +0100 Subject: [PATCH] Add missing check in cosnume-character HTML stream method Should only advance location if not reconsuming previous character --- HTMLKit/HTMLInputStreamReader.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HTMLKit/HTMLInputStreamReader.m b/HTMLKit/HTMLInputStreamReader.m index 2493b44..3df5f8d 100644 --- a/HTMLKit/HTMLInputStreamReader.m +++ b/HTMLKit/HTMLInputStreamReader.m @@ -130,9 +130,11 @@ { UTF32Char nextInputCharacter = [self nextInputCharacter]; if (nextInputCharacter == character) { - _location += _consume; - _scanner.scanLocation = _location; - _currentInputCharacter = nextInputCharacter; + if (!_reconsume) { + _location += _consume; + _scanner.scanLocation = _location; + _currentInputCharacter = nextInputCharacter; + } _reconsume = NO; return YES; }