* optionally ignore invalid (unknown) message flag letters, update callers

This commit is contained in:
djcb
2012-06-01 14:03:43 +02:00
parent 7008e108ae
commit 895ab10a4b
6 changed files with 22 additions and 11 deletions

View File

@ -162,7 +162,8 @@ mu_flags_to_str_s (MuFlags flags, MuFlagType types)
MuFlags
mu_flags_from_str (const char *str, MuFlagType types)
mu_flags_from_str (const char *str, MuFlagType types,
gboolean ignore_invalid)
{
const char *cur;
MuFlags flag;
@ -174,6 +175,13 @@ mu_flags_from_str (const char *str, MuFlagType types)
MuFlags f;
f = mu_flag_from_char (*cur);
if (f == MU_FLAG_INVALID) {
if (ignore_invalid)
continue;
return MU_FLAG_INVALID;
}
if (mu_flag_type (f) & types)
flag |= f;
}