From 7e2547b1e4c5b6e940506ddff80e8871ada029ea Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 18 Jun 2010 02:21:02 -0400 Subject: A metadata key must occur at the beginning Before, this was valid: ; Today Yesterday: Tomorrow Which would set the key Yesterday to the value Tomorrow. Now, it is just an ordinary comment. --- src/item.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/item.cc') diff --git a/src/item.cc b/src/item.cc index 3845e4cb..9290ab2f 100644 --- a/src/item.cc +++ b/src/item.cc @@ -166,6 +166,7 @@ void item_t::parse_tags(const char * p, string tag; bool by_value = false; + bool first = true; for (char * q = std::strtok(buf.get(), " \t"); q; q = std::strtok(NULL, " \t")) { @@ -191,7 +192,7 @@ void item_t::parse_tags(const char * p, (*i).second.second = true; } } - else if (q[len - 1] == ':') { // a metadata setting + else if (first && q[len - 1] == ':') { // a metadata setting int index = 1; if (q[len - 2] == ':') { by_value = true; @@ -199,6 +200,7 @@ void item_t::parse_tags(const char * p, } tag = string(q, len - index); } + first = false; } } -- cgit v1.2.3