mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
/LAST didn't work when window's max. number of lines was full + a few
cleanups. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@210 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ee254bd146
commit
d729474195
@ -181,11 +181,11 @@ static void cmd_lastlog(const char *data)
|
||||
if (count == 0) count = -1;
|
||||
|
||||
level = lastlog_parse_args(args, &flags);
|
||||
startline = lastlog_window_startline(flags & LASTLOG_FLAG_NEW);
|
||||
|
||||
if ((flags & LASTLOG_FLAG_NOHEADERS) == 0)
|
||||
printformat(NULL, NULL, MSGLEVEL_LASTLOG, IRCTXT_LASTLOG_START);
|
||||
|
||||
startline = lastlog_window_startline(flags & LASTLOG_FLAG_NEW);
|
||||
list = gui_window_find_text(active_win, text, startline, flags & LASTLOG_FLAG_REGEXP, flags & LASTLOG_FLAG_WORD);
|
||||
tmp = lastlog_find_startline(list, count, atoi(start), level);
|
||||
|
||||
|
@ -613,13 +613,10 @@ GList *gui_window_find_text(WINDOW_REC *window, gchar *text, GList *startline, i
|
||||
g_return_val_if_fail(window != NULL, NULL);
|
||||
g_return_val_if_fail(text != NULL, NULL);
|
||||
|
||||
text = g_strdup(text); g_strup(text);
|
||||
matches = NULL; size = 1024; str = g_malloc(1024);
|
||||
|
||||
if (regcomp(&preg, text, REG_EXTENDED|REG_NOSUB) != 0) {
|
||||
g_free(text);
|
||||
if (regcomp(&preg, text, REG_ICASE|REG_EXTENDED|REG_NOSUB) != 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (startline == NULL) startline = WINDOW_GUI(window)->lines;
|
||||
for (tmp = startline; tmp != NULL; tmp = tmp->next)
|
||||
@ -656,9 +653,9 @@ GList *gui_window_find_text(WINDOW_REC *window, gchar *text, GList *startline, i
|
||||
}
|
||||
str[n] = '\0';
|
||||
|
||||
if (regexp ? /*regexec(&preg, str, 0, NULL, 0) == 0*/regexp_match(str, text) :
|
||||
if (regexp ? regexec(&preg, str, 0, NULL, 0) == 0 :
|
||||
fullword ? stristr_full(str, text) != NULL :
|
||||
strstr(str, text) != NULL) {
|
||||
stristr(str, text) != NULL) {
|
||||
/* matched */
|
||||
matches = g_list_append(matches, rec);
|
||||
}
|
||||
@ -666,7 +663,6 @@ GList *gui_window_find_text(WINDOW_REC *window, gchar *text, GList *startline, i
|
||||
regfree(&preg);
|
||||
|
||||
if (str != NULL) g_free(str);
|
||||
g_free(text);
|
||||
return matches;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user