Branch: Tag:

2005-01-07

2005-01-07 20:06:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed bug in String.Replace.
Thanks to Dan Nelson <dan@emphone.com> for noticing.

Rev: src/builtin.cmod:1.176

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.175 2004/12/21 20:46:09 grubba Exp $ + || $Id: builtin.cmod,v 1.176 2005/01/07 20:06:45 grubba Exp $   */      #include "global.h"
1950:    Pike_error("Replace must have equal-sized from and to arrays.\n");    }    +  if (!from->size) { +  /* Enter no-op mode. */ +  THIS->sz = 0; +  pop_n_elems(args); +  push_int(0); +  return; +  } +     if( (from->type_field & ~BIT_STRING) &&    (array_fix_type_field(from) & ~BIT_STRING) )    SIMPLE_BAD_ARG_ERROR("Replace", 1, "array(string)");