On Tue, 03 Jul 2007 09:34:29 -0700 "Andy Lester via RT" <[EMAIL PROTECTED]> wrote:
> > Sooo... I'm not sure if the "rep" argument is NULL for the same > > *reason* as the above script (a comment from Coke has made me > > paranoid that a DOD run may be to blame), but should this emit an > > error message, or fix it up by using '' instead, or punt to the > > 3-argument substr() instead, rather than segfaulting? > > The problem seems to be that string_replace's rep should indeed be NN, > not NULLOK. Do you see when it would make sense to pass in NULL rep > to string_replace? I don't think so, there's a separate string_substr() function for that, and the other variants of the "substr" op use that one instead of this. I think the problem is two-fold. Problem 1, why does string_replace() crash when passed a NULL rep argument? Problem 2, why is this test case passing a NULL pointer all of a sudden, exposing Problem #1? Presumably, this used to work. My simplified test case demonstrates Problem #1, but I've thus far failed to figure Problem #2 out. Mark