[Fix] Re: [Bug?] #findBetweenSubStrs:

russell.allen at firebirdmedia.com russell.allen at firebirdmedia.com
Fri Jun 9 01:39:58 UTC 2000


Thanks!

:)
Russell

Bijan Parsia <bparsia at email.unc.edu> wrote:
> On Thu, 8 Jun 2000 russell.allen at firebirdmedia.com wrote:
> 
> > Hi
> > 
> > When I try to do:
> > 
> > 'A reference to <A HREF="someurl">Copyright Act 1968</A>?> '
> > findBetweenSubStrs: {'<A HREF="' . '">' . '</A>'}
> > 
> > I get an error: Subscript is out of bounds.
> 
> I tracked it down. It's actually a bug in
> String>>findAnySubStr:startingAt: It doesn't check that the substr you're
> trying to match would actually *fit* into the receiver starting at the
> startingAt:. Nor does it trap the overflow when it happens. Your example
> exposed it because your first substr is size 9, and a match is attempted
> at position 52 of a size 58 str.
> 
> I think a test for subStr size < self size - startingAt: is the right fix
> (will speed up ed matches of large substrs in certain cases).
> 
> And it's attached, .gzed an everything ;)
> 
> Cheers,
> Bijan Parsia
> 
> "Ohmygod...something *useful*!"

----------------------------------------
Russell Allen

russell.allen at firebirdmedia.com

----------------------------------------





More information about the Squeak-dev mailing list