mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
Move the validation of the CHOICE setting value
Also, use a FORMAT to show the error message.
This commit is contained in:
parent
6f795f020d
commit
9a30ab53df
4 changed files with 13 additions and 7 deletions
|
|
@ -106,7 +106,15 @@ static void set_choice(const char *key, const char *value)
|
|||
|
||||
stripped_value = g_strdup(value);
|
||||
g_strstrip(stripped_value);
|
||||
settings_set_choice(key, stripped_value);
|
||||
|
||||
if (settings_set_choice(key, stripped_value) == FALSE) {
|
||||
SETTINGS_REC *rec = settings_get_record(key);
|
||||
char *msg = g_strjoinv(",", rec->choices);
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_INVALID_CHOICE, msg);
|
||||
g_free(msg);
|
||||
}
|
||||
|
||||
g_free(stripped_value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue