From: Tom Tromey Date: Tue, 30 Apr 2002 23:55:57 +0000 (+0000) Subject: re PR libgcj/6301 (gij -jar does not work) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=479060323b1f838dbd9f24eb034a5f3a55d5585f;p=gcc.git re PR libgcj/6301 (gij -jar does not work) * java/io/BufferedReader.java (fill): Handle case where markPos point to ignored \n. Fixes PR libgcj/6301. From-SVN: r52982 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7aaf7121fa0..9a0891bde09 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2002-04-30 Tom Tromey + + * java/io/BufferedReader.java (fill): Handle case where markPos + point to ignored \n. Fixes PR libgcj/6301. + 2002-04-29 Gerhard Tonn * java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for S/390. diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java index b3a7bed6157..b4cdb639b43 100644 --- a/libjava/java/io/BufferedReader.java +++ b/libjava/java/io/BufferedReader.java @@ -1,5 +1,5 @@ /* BufferedReader.java - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -355,7 +355,12 @@ public class BufferedReader extends Reader if (retAtEndOfBuffer && buffer[pos] == '\n') { --count; - pos++; + // If the mark was set to the location of the \n, then we + // must change it to fully pretend that the \n does not + // exist. + if (markPos == pos) + ++markPos; + ++pos; } return count;