On Oct 13, 2011, at 2:34 PM, William A. Rowe Jr. wrote: > On 10/13/2011 9:36 AM, Jim Jagielski wrote: >> >> I propose that if nmatch>AP_MAX_REG_MATCH, we return the orig >> string. From what I can tell, we've never returned NULL, unless >> the source itself was NULL, having our failure return the orig >> string seems safest. > > I can't see how this is possible. An error condition must be > triggered somehow, in the absence of giving the user a test to > determine if their ap_pregsub call would succeed. >
It looks like, no matter what, we will at least send back the null string "" but not NULL. Unless the source is NULL. Looking over core modules that use ap_pregsub(), we only like 50% of the time check return, and that for NULL. Which, like I said, it doesn't look like we could ever return. Since regsub_core() is static, we can change ap_pregsub() to now return NULL on errors if we like. Likely not a bad fix, esp for trunk, but not sure of the impact for 2.2/2.0...
