options: make --msglevel extend previous settings

Make it so --msglevel extends previous --msglevel uses, instead of
overwriting them. Do this by literally appending the --msglevel option
value to the previous one.
This commit is contained in:
wm4 2013-12-22 12:18:01 +01:00
parent 4833e92b54
commit bd5e0a2ba2
1 changed files with 10 additions and 3 deletions

View File

@ -1335,9 +1335,16 @@ static int parse_msglevels(struct mp_log *log, const m_option_t *opt,
}
}
if (dst) {
talloc_free(VAL(dst));
VAL(dst) = bstrdup0(NULL, param);
if (dst && param.len) {
char *prev = VAL(dst);
char *new;
if (prev && prev[0]) {
new = talloc_asprintf(NULL, "%s:%.*s", prev, BSTR_P(param));
} else {
new = bstrdup0(NULL, param);
}
talloc_free(prev);
VAL(dst) = new;
}
return 1;