diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:33:06 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:33:06 -0400 |
commit | 69e2c733b922666a16ffeb5879eee13b32dc7662 (patch) | |
tree | 96fd9c89a1317aebab5a6f627374a59e2e833f2b | |
parent | badea0058402837961125bd000ced2a132591cbf (diff) | |
download | fork-ledger-69e2c733b922666a16ffeb5879eee13b32dc7662.tar.gz fork-ledger-69e2c733b922666a16ffeb5879eee13b32dc7662.tar.bz2 fork-ledger-69e2c733b922666a16ffeb5879eee13b32dc7662.zip |
If an item tag is already set, don't overwrite it
-rw-r--r-- | src/item.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/item.cc b/src/item.cc index f45e87e3..93aba0b3 100644 --- a/src/item.cc +++ b/src/item.cc @@ -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 |