projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix spuriously slow check in twoway strstr/memmem cores
[musl]
/
src
/
string
/
strstr.c
diff --git
a/src/string/strstr.c
b/src/string/strstr.c
index
cd06912
..
c80e9ca
100644
(file)
--- a/
src/string/strstr.c
+++ b/
src/string/strstr.c
@@
-110,7
+110,7
@@
static char *twoway_strstr(const unsigned char *h, const unsigned char *n)
k = l-shift[h[l-1]];
//printf("adv by %zu (on %c) at [%s] (%zu;l=%zu)\n", k, h[l-1], h, shift[h[l-1]], l);
if (k) {
k = l-shift[h[l-1]];
//printf("adv by %zu (on %c) at [%s] (%zu;l=%zu)\n", k, h[l-1], h, shift[h[l-1]], l);
if (k) {
- if (mem
0 && mem
&& k < p) k = l-p;
+ if (mem && k < p) k = l-p;
h += k;
mem = 0;
continue;
h += k;
mem = 0;
continue;