Only look for [date] outside of metadata entries
This commit is contained in:
parent
31e8ed7587
commit
805a78c121
1 changed files with 15 additions and 15 deletions
30
src/item.cc
30
src/item.cc
|
|
@ -138,26 +138,26 @@ void item_t::parse_tags(const char * p,
|
||||||
scope_t& scope,
|
scope_t& scope,
|
||||||
bool overwrite_existing)
|
bool overwrite_existing)
|
||||||
{
|
{
|
||||||
if (const char * b = std::strchr(p, '[')) {
|
if (! std::strchr(p, ':')) {
|
||||||
if (*(b + 1) != '\0' &&
|
if (const char * b = std::strchr(p, '[')) {
|
||||||
(std::isdigit(*(b + 1)) || *(b + 1) == '=')) {
|
if (*(b + 1) != '\0' &&
|
||||||
if (const char * e = std::strchr(p, ']')) {
|
(std::isdigit(*(b + 1)) || *(b + 1) == '=')) {
|
||||||
char buf[256];
|
if (const char * e = std::strchr(p, ']')) {
|
||||||
std::strncpy(buf, b + 1, e - b - 1);
|
char buf[256];
|
||||||
buf[e - b - 1] = '\0';
|
std::strncpy(buf, b + 1, e - b - 1);
|
||||||
|
buf[e - b - 1] = '\0';
|
||||||
|
|
||||||
if (char * p = std::strchr(buf, '=')) {
|
if (char * p = std::strchr(buf, '=')) {
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
_date_eff = parse_date(p);
|
_date_eff = parse_date(p);
|
||||||
|
}
|
||||||
|
if (buf[0])
|
||||||
|
_date = parse_date(buf);
|
||||||
}
|
}
|
||||||
if (buf[0])
|
|
||||||
_date = parse_date(buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! std::strchr(p, ':'))
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
scoped_array<char> buf(new char[std::strlen(p) + 1]);
|
scoped_array<char> buf(new char[std::strlen(p) + 1]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue