mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
Reject invalid level specifications in /set.
Most of these have names that end in "_level". git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5021 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
946e7784b0
commit
cb1f07352a
12 changed files with 26 additions and 12 deletions
|
|
@ -81,11 +81,14 @@ int level_get(const char *level)
|
|||
return match;
|
||||
}
|
||||
|
||||
int level2bits(const char *level)
|
||||
int level2bits(const char *level, int *errorp)
|
||||
{
|
||||
char *orig, *str, *ptr;
|
||||
int ret, singlelevel, negative;
|
||||
|
||||
if (errorp != NULL)
|
||||
*errorp = FALSE;
|
||||
|
||||
g_return_val_if_fail(level != NULL, 0);
|
||||
|
||||
if (*level == '\0')
|
||||
|
|
@ -107,7 +110,8 @@ int level2bits(const char *level)
|
|||
if (singlelevel != 0) {
|
||||
ret = !negative ? (ret | singlelevel) :
|
||||
(ret & ~singlelevel);
|
||||
}
|
||||
} else if (errorp != NULL)
|
||||
*errorp = TRUE;
|
||||
|
||||
while (*str == ' ') str++;
|
||||
if (*str == '\0') break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue