From 3be50a5d4f804ee46689266d77acc89c371a00db Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 15 Sep 2015 17:28:56 +0800 Subject: [PATCH] JSDOC/TextStream.vala --- JSDOC/TextStream.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/JSDOC/TextStream.vala b/JSDOC/TextStream.vala index 4ebddae..9182c28 100644 --- a/JSDOC/TextStream.vala +++ b/JSDOC/TextStream.vala @@ -37,7 +37,7 @@ namespace JSDOC { if (this.cursor+n < 0 || this.cursor+n >= this.length) { return '\0'; } - return this.text[this.cursor+n]; + return this.get_char(this.cursor+n); }, public bool lookEOF(int n = 0) @@ -57,9 +57,11 @@ namespace JSDOC { } char pulled; - for (var i = 0; i < n; i++) { + var i = 0; + while (i < n) { if (this.cursor+i < this.length) { pulled += this.text.get_char(this.cursor+i); + i+=pulled.to_string.length(); } else { eof =true; return '\0'; -- 2.39.2