If an item tag is already set, don't overwrite it

This commit is contained in:
John Wiegley 2009-02-26 05:33:06 -04:00
parent badea00584
commit 69e2c733b9

View file

@ -140,7 +140,8 @@ void item_t::parse_tags(const char * p, int current_year)
q = std::strtok(NULL, " \t")) {
const std::size_t len = std::strlen(q);
if (! tag.empty()) {
set_tag(tag, string(p + (q - buf.get())));
if (! has_tag(tag))
set_tag(tag, string(p + (q - buf.get())));
break;
}
else if (q[0] == ':' && q[len - 1] == ':') { // a series of tags