projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged Irssi SVN (upcoming irssi 0.8.11).
[silc.git]
/
apps
/
irssi
/
src
/
core
/
log.c
diff --git
a/apps/irssi/src/core/log.c
b/apps/irssi/src/core/log.c
index 75768601839e558bb29d471e52ba10c53363a0fb..4d49402e371798e8ae452729ac54dfef5667bc84 100644
(file)
--- a/
apps/irssi/src/core/log.c
+++ b/
apps/irssi/src/core/log.c
@@
-246,18
+246,28
@@
void log_write_rec(LOG_REC *log, const char *str, int level)
g_free_not_null(colorstr);
}
g_free_not_null(colorstr);
}
+static int itemcmp(const char *patt, const char *item)
+{
+ /* returns 0 on match, nonzero otherwise */
+
+ if (item == NULL)
+ return g_strcasecmp(patt, "*") != 0;
+ if (*patt == '*')
+ return 0;
+ return g_strcasecmp(patt, item);
+}
+
LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item,
const char *servertag)
{
GSList *tmp;
g_return_val_if_fail(log != NULL, NULL);
LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item,
const char *servertag)
{
GSList *tmp;
g_return_val_if_fail(log != NULL, NULL);
- g_return_val_if_fail(item != NULL, NULL);
for (tmp = log->items; tmp != NULL; tmp = tmp->next) {
LOG_ITEM_REC *rec = tmp->data;
for (tmp = log->items; tmp != NULL; tmp = tmp->next) {
LOG_ITEM_REC *rec = tmp->data;
- if (rec->type == type &&
g_strcase
cmp(rec->name, item) == 0 &&
+ if (rec->type == type &&
item
cmp(rec->name, item) == 0 &&
(rec->servertag == NULL || (servertag != NULL &&
g_strcasecmp(rec->servertag, servertag) == 0)))
return rec;
(rec->servertag == NULL || (servertag != NULL &&
g_strcasecmp(rec->servertag, servertag) == 0)))
return rec;