mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 09:02:13 +02:00
Don't expand ALL when combined with NEVER/NO_ACT
This commit is contained in:
parent
819f9d16c9
commit
d84811b192
1 changed files with 13 additions and 7 deletions
|
|
@ -136,19 +136,25 @@ char *bits2level(int bits)
|
||||||
if (bits == 0)
|
if (bits == 0)
|
||||||
return g_strdup("");
|
return g_strdup("");
|
||||||
|
|
||||||
if (bits == MSGLEVEL_ALL)
|
|
||||||
return g_strdup("ALL");
|
|
||||||
|
|
||||||
str = g_string_new(NULL);
|
str = g_string_new(NULL);
|
||||||
if (bits & MSGLEVEL_NEVER)
|
if (bits & MSGLEVEL_NEVER) {
|
||||||
g_string_append(str, "NEVER ");
|
g_string_append(str, "NEVER ");
|
||||||
|
bits &= ~MSGLEVEL_NEVER;
|
||||||
|
}
|
||||||
|
|
||||||
if (bits & MSGLEVEL_NO_ACT)
|
if (bits & MSGLEVEL_NO_ACT) {
|
||||||
g_string_append(str, "NO_ACT ");
|
g_string_append(str, "NO_ACT ");
|
||||||
|
bits &= ~MSGLEVEL_NO_ACT;
|
||||||
|
}
|
||||||
|
|
||||||
for (n = 0; levels[n] != NULL; n++) {
|
if (bits == MSGLEVEL_ALL) {
|
||||||
if (bits & (1L << n))
|
g_string_append(str, "ALL ");
|
||||||
g_string_append_printf(str, "%s ", levels[n]);
|
} else {
|
||||||
|
for (n = 0; levels[n] != NULL; n++) {
|
||||||
|
if (bits & (1L << n))
|
||||||
|
g_string_append_printf(str, "%s ", levels[n]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (str->len > 0)
|
if (str->len > 0)
|
||||||
g_string_truncate(str, str->len-1);
|
g_string_truncate(str, str->len-1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue