summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-18 00:46:37 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-18 00:46:37 -0400
commit805a78c121eb0b05fd52439ad658e1eb2cc81a48 (patch)
treefb1bbb0dcb17474edf3041ce15a9ced50bd186e0 /src/item.cc
parent31e8ed7587f6c7dc54e9623dd6a4e09ad5b6b017 (diff)
downloadfork-ledger-805a78c121eb0b05fd52439ad658e1eb2cc81a48.tar.gz
fork-ledger-805a78c121eb0b05fd52439ad658e1eb2cc81a48.tar.bz2
fork-ledger-805a78c121eb0b05fd52439ad658e1eb2cc81a48.zip
Only look for [date] outside of metadata entries
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/item.cc b/src/item.cc
index 63f0f3a9..4e9c7702 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -138,26 +138,26 @@ void item_t::parse_tags(const char * p,
scope_t& scope,
bool overwrite_existing)
{
- if (const char * b = std::strchr(p, '[')) {
- if (*(b + 1) != '\0' &&
- (std::isdigit(*(b + 1)) || *(b + 1) == '=')) {
- if (const char * e = std::strchr(p, ']')) {
- char buf[256];
- std::strncpy(buf, b + 1, e - b - 1);
- buf[e - b - 1] = '\0';
-
- if (char * p = std::strchr(buf, '=')) {
- *p++ = '\0';
- _date_eff = parse_date(p);
+ if (! std::strchr(p, ':')) {
+ if (const char * b = std::strchr(p, '[')) {
+ if (*(b + 1) != '\0' &&
+ (std::isdigit(*(b + 1)) || *(b + 1) == '=')) {
+ if (const char * e = std::strchr(p, ']')) {
+ char buf[256];
+ std::strncpy(buf, b + 1, e - b - 1);
+ buf[e - b - 1] = '\0';
+
+ if (char * p = std::strchr(buf, '=')) {
+ *p++ = '\0';
+ _date_eff = parse_date(p);
+ }
+ if (buf[0])
+ _date = parse_date(buf);
}
- if (buf[0])
- _date = parse_date(buf);
}
}
- }
-
- if (! std::strchr(p, ':'))
return;
+ }
scoped_array<char> buf(new char[std::strlen(p) + 1]);