Use explicit values for current-consumed characters in Input Stream Reader class

This commit is contained in:
iska
2014-10-04 21:56:22 +02:00
parent 26e7ba35d0
commit 19ae5b0516
+5 -5
View File
@@ -50,15 +50,15 @@
- (UTF32Char)nextInputCharacter
{
if (_location >= _string.length) return EOF;
_consume = 1;
_consume = 0;
UTF32Char nextInputCharacter = CFStringGetCharacterFromInlineBuffer(&_buffer, _location);
if (nextInputCharacter == 0) return EOF;
if (nextInputCharacter == 0 && _location >= _string.length) return EOF;
_consume = 1;
if (nextInputCharacter == CARRIAGE_RETURN) {
UniChar next = CFStringGetCharacterFromInlineBuffer(&_buffer, _location + 1);
if (next == LINE_FEED) _consume++;
if (next == LINE_FEED) _consume = 2;
return LINE_FEED;
}
if (CFStringIsSurrogateLowCharacter(nextInputCharacter)) {