Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
idnode: fix idnode_slist_set, fixes #3646
  • Loading branch information
perexg committed Mar 30, 2016
1 parent 3a827e7 commit 7965ebd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/bouquet.c
Expand Up @@ -977,6 +977,7 @@ const idclass_t bouquet_class = {
},
{
.type = PT_INT,
.islist = 1,
.id = "mapopt",
.name = N_("Channel mapping options"),
.desc = N_("Options to use/used when mapping "
Expand All @@ -993,11 +994,11 @@ const idclass_t bouquet_class = {
.get = bouquet_class_mapopt_get,
.set = bouquet_class_mapopt_set,
.rend = bouquet_class_mapopt_rend,
.opts = PO_ADVANCED,
.islist = 1
.opts = PO_ADVANCED
},
{
.type = PT_INT,
.islist = 1,
.id = "chtag",
.name = N_("Create tags"),
.desc = N_("Create and link these tags to channels when "
Expand All @@ -1016,8 +1017,7 @@ const idclass_t bouquet_class = {
.get = bouquet_class_chtag_get,
.set = bouquet_class_chtag_set,
.rend = bouquet_class_chtag_rend,
.opts = PO_ADVANCED,
.islist = 1
.opts = PO_ADVANCED
},
{
.type = PT_STR,
Expand Down
21 changes: 12 additions & 9 deletions src/idnode.c
Expand Up @@ -1535,18 +1535,21 @@ idnode_slist_set ( idnode_t *in, idnode_slist_t *options, const htsmsg_t *vals )

for (o = options; o->id; o++) {
ip = (void *)in + o->off;
HTSMSG_FOREACH(f, vals) {
if ((s = htsmsg_field_get_str(f)) != NULL)
continue;
if (strcmp(s, o->id))
continue;
if (*ip == 0) changed = 1;
break;
if (!changed) {
HTSMSG_FOREACH(f, vals) {
if ((s = htsmsg_field_get_str(f)) != NULL)
continue;
if (strcmp(s, o->id))
continue;
if (*ip == 0) changed = 1;
break;
}
if (f == NULL && *ip) changed = 1;
}
if (f == NULL && *ip) changed = 1;
*ip = 0;
}
HTSMSG_FOREACH(f, vals) {
if ((s = htsmsg_field_get_str(f)) != NULL)
if ((s = htsmsg_field_get_str(f)) == NULL)
continue;
for (o = options; o->id; o++) {
if (strcmp(o->id, s)) continue;
Expand Down

0 comments on commit 7965ebd

Please sign in to comment.