memmem, strstr, strcasestr: fix bug with long periodic needle
[gnulib.git] / lib / str-two-way.h
index dbc2f88..5f150af 100644 (file)
@@ -370,8 +370,8 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
                      a byte out of place, there can be no match until
                      after the mismatch.  */
                   shift = needle_len - period;
-                  memory = 0;
                 }
+              memory = 0;
               j += shift;
               continue;
             }