updates.
[runtime.git] / apps / irssi / src / fe-text / textbuffer.c
index 8ac8bf0043efdb0fa7d3c8f40d2c5886efe9a213..ee11aa67a738acba090b9a7e8d57ea78f5b25742 100644 (file)
@@ -518,7 +518,8 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
                         textbuffer_line_ref(line);
                        matches = g_list_append(matches, line);
 
-                       if (!line_matched && --match_after == 0)
+                       if ((!line_matched && --match_after == 0) ||
+                           (line_matched && match_after == 0 && before > 0))
                                matches = g_list_append(matches, NULL);
                }
        }