cvsuser     05/01/29 06:14:07

  Modified:    io       io_buf.c
  Log:
  fix 33963
  
  Revision  Changes    Path
  1.33      +19 -14    parrot/io/io_buf.c
  
  Index: io_buf.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io_buf.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- io_buf.c  9 Jan 2005 14:50:59 -0000       1.32
  +++ io_buf.c  29 Jan 2005 14:14:07 -0000      1.33
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: io_buf.c,v 1.32 2005/01/09 14:50:59 leo Exp $
  +$Id: io_buf.c,v 1.33 2005/01/29 14:14:07 leo Exp $
   
   =head1 NAME
   
  @@ -481,19 +481,6 @@
       return current + len;
   }
   
  -/*
  -
  -=item C<static size_t
  -PIO_buf_readline(theINTERP, ParrotIOLayer *layer, ParrotIO *io,
  -                 void *buffer, size_t len)>
  -
  -This is called from C<PIO_buf_read()> to do line buffered reading if
  -that is what is required.
  -
  -=cut
  -
  -*/
  -
   static size_t
   PIO_buf_peek(theINTERP, ParrotIOLayer *layer, ParrotIO *io, STRING **buf)
   {
  @@ -540,6 +527,19 @@
       goto ret_string;
   }
   
  +/*
  +
  +=item C<static size_t
  +PIO_buf_readline(theINTERP, ParrotIOLayer *layer, ParrotIO *io,
  +                 void *buffer, size_t len)>
  +
  +This is called from C<PIO_buf_read()> to do line buffered reading if
  +that is what is required.
  +
  +=cut
  +
  +*/
  +
   
   static size_t
   PIO_buf_readline(theINTERP, ParrotIOLayer *layer, ParrotIO *io,
  @@ -572,6 +572,11 @@
           if (IS_EOL(io, b->next++)) {
               break;
           }
  +        /* if there is a buffer, readline is called by the read opcode
  +         * - return just that part
  +         */
  +        if (s->bufused && l == s->bufused)
  +            break;
           /* buffer completed; copy out and refill */
           if (b->next == b->endb) {
               len = b->endb - buf_start;
  
  
  

Reply via email to