On Tue, 3 Jul 2007 12:10:37 -0500 Andy Lester <[EMAIL PROTECTED]> wrote: > > Problem 2, why is this test case passing a NULL pointer all of a > > sudden, exposing Problem #1? Presumably, this used to work. > > That I can't tell. All I'm looking at is the underlying C code, > where it seems to me that passing in a rep of NULL should not be > allowed.
Agreed, and this should be fixed. I'm just worried that this is working around a symptom, rather than the actual bug (which is that the regexdna.pir shooutout test has changed behavior, and begun passing a NULL pointer). I tried various workarounds... calling string_substr() from substr_s_i_i_s if rep was null, passing to string_substr() from within string_replace() if rep was null, that kind of thing. The shootout test runs to completion, but still fails: the last line of output had some differing digits. (Apparently some string was supposed to be replaced, and just returning a substr without replacing anything isn't sufficient.) So, while I agree that the "crashing on NULL rep" bug needs to be fixed, I've been mostly focusing on staring at regexdna.pir, hoping to find a fix for the "passing a NULL rep in the first place" bug. Mark