From: Fredrik Tolf Date: Sun, 15 Nov 2009 18:18:31 +0000 (+0100) Subject: Bugfixed the PeekReader. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=bce78e9e695e185501a05474b4862fe30a45863f;p=jsvc.git Bugfixed the PeekReader. --- diff --git a/src/dolda/jsvc/next/PeekReader.java b/src/dolda/jsvc/next/PeekReader.java index 1c3fce5..7981c43 100644 --- a/src/dolda/jsvc/next/PeekReader.java +++ b/src/dolda/jsvc/next/PeekReader.java @@ -46,12 +46,10 @@ public class PeekReader extends Reader { } public int peek(boolean skipws) throws IOException { - if(p) - return(la); - do { + while(!p || (skipws && (la >= 0) && whitespace((char)la))) { la = back.read(); p = true; - } while(skipws && (la >= 0) && whitespace((char)la)); + } return(la); }