From: Gisle Aas Date: Wed, 28 Dec 2005 11:01:46 +0000 (+0000) Subject: Remove test for NUL ending in r?instr(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=260d78c9ff623f5d456f7d39acc9715eec2a85f4;p=p5sagit%2Fp5-mst-13.2.git Remove test for NUL ending in r?instr(). This test is actually harmful because we will search for any garbage found past the empty search string. Ref change 26509. p4raw-id: //depot/perl@26510 --- diff --git a/util.c b/util.c index a88d988..c082f5b 100644 --- a/util.c +++ b/util.c @@ -356,7 +356,7 @@ Perl_ninstr(pTHX_ register const char *big, register const char *bigend, const c register const I32 first = *little; register const char * const littleend = lend; - if (!first && little >= littleend) + if (little >= littleend) return (char*)big; if (bigend - big < littleend - little) return Nullch; @@ -388,7 +388,7 @@ Perl_rninstr(pTHX_ register const char *big, const char *bigend, const char *lit register const I32 first = *little; register const char * const littleend = lend; - if (!first && little >= littleend) + if (little >= littleend) return (char*)bigend; bigbeg = big; big = bigend - (littleend - little++);