summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-05-10 22:17:22 -0600
committerKarl Williamson <khw@cpan.org>2016-05-12 20:24:55 -0600
commitb8070b0795640313148acfe846c5f9320bec5745 (patch)
treeefdf6391485e5c57c05afc70e0e0bc16e4e054bf /util.c
parent5f81fa4069cb15ccd77b1c4253c870df84c1788a (diff)
downloadperl-b8070b0795640313148acfe846c5f9320bec5745.tar.gz
Use memmem() if available on the platform for Perl_ninstr()
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 447a19fc13..2f788251b4 100644
--- a/util.c
+++ b/util.c
@@ -584,6 +584,11 @@ char *
Perl_ninstr(const char *big, const char *bigend, const char *little, const char *lend)
{
PERL_ARGS_ASSERT_NINSTR;
+
+#ifdef HAS_MEMMEM
+ return ninstr(big, bigend, little, lend);
+#else
+
if (little >= lend)
return (char*)big;
{
@@ -602,6 +607,9 @@ Perl_ninstr(const char *big, const char *bigend, const char *little, const char
}
}
return NULL;
+
+#endif
+
}
/*