This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: PR 6301 fix


I'm checking this in on the trunk.

This fixes PR 6301.  It is a pretty obscure bug.  I've added a Mauve
test case for it.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/io/BufferedReader.java (fill): Handle case where markPos
	point to ignored \n.  Fixes PR libgcj/6301.

Index: java/io/BufferedReader.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/BufferedReader.java,v
retrieving revision 1.9
diff -u -r1.9 BufferedReader.java
--- java/io/BufferedReader.java 22 Jan 2002 22:40:13 -0000 1.9
+++ java/io/BufferedReader.java 30 Apr 2002 23:49:59 -0000
@@ -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 @@
     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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]