pike.git / src / modules / _Stdio / buffer.cmod

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:153:    {    /* do not count this one, since it comes from add and would    * have been a copy normally.    */    memcpy( io->stash.ptr, io_read_pointer( io ), io_len(io) );    }    io->buffer = io->stash.ptr;    io->len = io_len(io);    io->offset = 0;    io->allocated = io->stash.len; +  if( io->sub ) { +  io_unlock( get_storage(io->sub,IOBuffer_program ) ); +  free_object( io->sub ); +  } +  if( io->source ) free_object( io->source ); +  if( io->str ) free_string( io->str ); +  io->source = 0; +  io->sub = 0; +  io->str = 0;    io->malloced = 1;    }    else    free( io->stash.ptr );    io->stash.ptr = 0;    io->stash.len = 0;    return io->malloced;    }       static void io_stash_malloc( IOBuffer *io )
pike.git/src/modules/_Stdio/buffer.cmod:728:    Pike_error("Non integer argument\n");    }       static void io_append_svalue( IOBuffer *io, struct svalue *p )    {    switch( TYPEOF(*p) )    {    case PIKE_T_STRING:    {    struct pike_string *s = p->u.string; +  if( !s->len ) return;    if( s->size_shift ) Pike_error("IOBuffer only handles 8bit data\n");    if( !io->buffer )    { -  + #ifdef PIKE_DEBUG +  if (io->str) Pike_fatal("IOBuffer with string but NULL buffer.\n"); + #endif    io->str = s;    io->buffer = (unsigned char*)s->str;    io->len = s->len;    s->refs++;    }    else    io_append( io, s->str, s->len );    }    break;    case PIKE_T_ARRAY: