Branch: Tag:

2019-06-16

2019-06-16 12:48:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio.Buffer: Fixed input_from() with non-Stdio.File objects.

The return value from input_from() was always -1 when it was called
with non-Stdio.File objects (even if it successfully read data).

This issue is triggered by the testsuite for the Filesystem module.

948:    }    else    { -  /* some other object. Just call read */ +  /* Some other object. Just call read(). */    while( nbytes )    {    push_int( MINIMUM(READ_CHUNKSIZE, nbytes) );
959:    Pike_error("Can not handle non-8bit data.\n");    io_append( io, Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len );    nbytes -= Pike_sp[-1].u.string->len; +  bread += Pike_sp[-1].u.string->len;    pop_stack();    }    }