updates.
[silc.git] / apps / irssi / src / fe-text / textbuffer.c
index 8ac8bf0043efdb0fa7d3c8f40d2c5886efe9a213..e989b8fda140c853ed205a6f71dc91e415039ba5 100644 (file)
@@ -18,6 +18,8 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define        G_LOG_DOMAIN "TextBuffer"
+
 #include "module.h"
 #include "misc.h"
 #include "formats.h"
@@ -518,7 +520,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);
                }
        }