Another fix to metadata value parsing
This commit is contained in:
parent
65835a89cc
commit
89e0472b50
1 changed files with 9 additions and 15 deletions
24
src/item.cc
24
src/item.cc
|
|
@ -189,22 +189,16 @@ void item_t::parse_tags(const char * p,
|
||||||
tag = string(q, len - index);
|
tag = string(q, len - index);
|
||||||
|
|
||||||
string_map::iterator i;
|
string_map::iterator i;
|
||||||
const string::size_type plen = std::strlen(p);
|
string field(p + len + index);
|
||||||
const char * v = p + (q - p) + (len - index) + 1;
|
trim(field);
|
||||||
while (*v == '\0' && v < p + plen)
|
if (by_value) {
|
||||||
++v;
|
bind_scope_t bound_scope(scope, *this);
|
||||||
|
i = set_tag(tag, expr_t(field).calc(bound_scope), overwrite_existing);
|
||||||
if (v < p + plen) {
|
} else {
|
||||||
string field(v);
|
i = set_tag(tag, string_value(field), overwrite_existing);
|
||||||
if (by_value) {
|
|
||||||
bind_scope_t bound_scope(scope, *this);
|
|
||||||
i = set_tag(tag, expr_t(field).calc(bound_scope), overwrite_existing);
|
|
||||||
} else {
|
|
||||||
i = set_tag(tag, string_value(field), overwrite_existing);
|
|
||||||
}
|
|
||||||
(*i).second.second = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
(*i).second.second = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue