diff --git a/src/searchutils.c b/src/searchutils.c
index 8c34e31..c9ad373 100644
--- a/src/searchutils.c
+++ b/src/searchutils.c
@@ -142,6 +142,6 @@ is_mb_middle (const char **good, const char *buf, const char *end,
     }
 
   *good = prev;
-  return p > buf || match_len < mbrlen (p, end - p, &cur_state);
+  return p > buf || (match_len > 0 && match_len < mbrlen (p, end - p, &cur_state));
 }
 #endif /* MBS_SUPPORT */
