diff -ur --exclude=CVS ../parrot-old/io/io.c ./io/io.c
--- ../parrot-old/io/io.c	Sat Jan 10 21:31:09 2004
+++ ./io/io.c	Thu Jan 22 20:29:24 2004
@@ -699,9 +699,6 @@
 }
 
 
-/*
- * Iterate down the stack to the first layer implementing "Read" API
- */
 INTVAL
 PIO_eof(theINTERP, PMC *pmc)
 {
diff -ur --exclude=CVS ../parrot-old/io/io_buf.c ./io/io_buf.c
--- ../parrot-old/io/io_buf.c	Sun Jan 18 21:30:41 2004
+++ ./io/io_buf.c	Thu Jan 22 20:29:14 2004
@@ -329,8 +329,10 @@
     if (!(b->flags & PIO_BF_READBUF)) {
         size_t got;
         if (len >= io->b.size) {
-            return current + PIO_read_down(interpreter, PIO_DOWNLAYER(l), 
-                                           io, buffer, len);
+            got = PIO_read_down(interpreter, PIO_DOWNLAYER(l), 
+                                           io, out_buf, len);
+            io->fpos += got;
+            return current + got;
         }
 
         got = PIO_buf_fill_readbuf(interpreter, l, io, b);
diff -ur --exclude=CVS ../parrot-old/t/src/io.t ./t/src/io.t
--- ../parrot-old/t/src/io.t	Sun Jan 11 21:31:14 2004
+++ ./t/src/io.t	Thu Jan 22 20:28:58 2004
@@ -1,6 +1,6 @@
 #! perl -w
 
-use Parrot::Test tests => 17;
+use Parrot::Test tests => 19;
 use Test::More;
 
 $/=undef; # slurp mode
@@ -353,6 +353,77 @@
 OUTPUT
 
 teardown();
+
+###############################################################################
+
+setup("temp.file", ("x" x 65536) . "yz");
+
+c_output_is($main . <<'CODE', <<'OUTPUT', "PIO_read larger chunk when the buffer is not-empty");
+static opcode_t*
+the_test(struct Parrot_Interp *interpreter,
+	 opcode_t *cur_op, opcode_t *start)
+{
+    PMC *io;
+    char *buffer;
+
+    io = PIO_open(interpreter, NULL, "temp.file", "<");
+
+    if ( !io ) {
+	PIO_printf(interpreter, "PIO_open failed\n");
+	return NULL;
+    }
+
+    buffer = malloc(65536 * sizeof(char));
+    buffer[65535] = '\0';
+    PIO_read(interpreter, io, buffer, 3);
+    printf("%i\n", PIO_read(interpreter, io, buffer, 65535));
+    printf("%s\n", &buffer[65532]);
+
+    return NULL;
+}
+CODE
+65535
+xyz
+OUTPUT
+
+teardown();
+
+###############################################################################
+
+setup("temp.file", "words\n" x 10000);
+
+c_output_is($main . <<'CODE', <<'OUTPUT', "PIO_tell: read larger chunk when the buffer is not-empty");
+static opcode_t*
+the_test(struct Parrot_Interp *interpreter,
+	 opcode_t *cur_op, opcode_t *start)
+{
+    PMC *io;
+    char *buf;
+
+    io = PIO_open(interpreter, NULL, "temp.file", "<");
+
+    if ( !io ) {
+	PIO_printf(interpreter, "PIO_open failed\n");
+	return NULL;
+    }
+
+    buf = malloc(65536 * sizeof(char));
+
+    printf("%d\n", PIO_tell(interpreter, io));
+    PIO_read(interpreter, io, buf, 6);
+    printf("%d\n", PIO_tell(interpreter, io));
+    PIO_read(interpreter, io, buf, 65535);
+    printf("%d\n", PIO_tell(interpreter, io));
+
+    return NULL;
+}
+CODE
+0
+6
+60000
+OUTPUT
+
+teardown();
 
 ###############################################################################
 
