aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog3
-rw-r--r--libjava/java/io/FileInputStream.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 322b39a..0b15ae6 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -2,6 +2,9 @@
* java/io/PushbackReader.java: Reformat.
+ * java/io/FileInputStream.java (skip): Call fd.getFilePointer() and
+ calculate correct number of bytes skipped.
+
2002-03-24 Tom Tromey <tromey@redhat.com>
* java/awt/TextComponent.java (TextComponent): Editable by
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index 9d0d013..6a02d2b 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -88,6 +88,8 @@ public class FileInputStream extends InputStream
public long skip(long n) throws IOException
{
- return n <= 0 ? 0 : fd.seek(n, FileDescriptor.CUR, true);
+ long startPos = fd.getFilePointer();
+ long endPos = fd.seek(n, FileDescriptor.CUR, true);
+ return endPos - startPos;
}
}