[PATCH] fix last corner case in strrstr.c
Bernhard Fischer
rep.dot.nop at gmail.com
Wed Jun 18 01:33:44 PDT 2008
On Tue, Jun 17, 2008 at 09:38:38PM +0200, Tito wrote:
>Hi,
>current implementation fails to be coherent with real strstr()
>on the last test case:
>./test
>'baaabaaab' vs. 'aaa' : PASSED
>'baaabaaaab' vs. 'aaa' : PASSED
>'baaabaab' vs. 'aaa' : PASSED
>'aaa' vs. 'aaa' : PASSED
>'aaa' vs. 'a' : PASSED
>'aaa' vs. 'bbb' : PASSED
>'a' vs. 'aaa' : PASSED
>'aaa' vs. '' : PASSED
>'' vs. 'aaa' : PASSED
>'' vs. '' : FAILED
>
>this patch fixes this with no size increase:
>
> ./test
>'baaabaaab' vs. 'aaa' : PASSED
>'baaabaaaab' vs. 'aaa' : PASSED
>'baaabaab' vs. 'aaa' : PASSED
>'aaa' vs. 'aaa' : PASSED
>'aaa' vs. 'a' : PASSED
>'aaa' vs. 'bbb' : PASSED
>'a' vs. 'aaa' : PASSED
>'aaa' vs. '' : PASSED
>'' vs. 'aaa' : PASSED
>'' vs. '' : PASSED
>
>./scripts/bloat-o-meter busybox_old busybox_unstripped
>function old new delta
>------------------------------------------------------------------------------
>(add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes
Thanks, applied.
More information about the busybox
mailing list