summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-30 02:55:02 -0600
committerJohn Wiegley <johnw@newartisans.com>2010-05-30 03:01:11 -0600
commit4f3b39e22c7a7743132ead79b1e092929679de44 (patch)
treeb49eeb433c03f71318b64a0dc4d0d0d5ebea2d4f /src/item.cc
parent647d4aac2fa474085d01f7ea1cebdc34fafd64a6 (diff)
downloadfork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.tar.gz
fork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.tar.bz2
fork-ledger-4f3b39e22c7a7743132ead79b1e092929679de44.zip
Empty notes and tags now return null values
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/item.cc b/src/item.cc
index 14a0896f..0a22b260 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -227,7 +227,7 @@ namespace {
return NULL_VALUE;
}
value_t get_note(item_t& item) {
- return string_value(item.note ? *item.note : empty_string);
+ return item.note ? string_value(*item.note) : NULL_VALUE;
}
value_t has_tag(call_scope_t& args) {
@@ -260,7 +260,8 @@ namespace {
return false;
}
- value_t get_tag(call_scope_t& args) {
+ value_t get_tag(call_scope_t& args)
+ {
item_t& item(find_scope<item_t>(args));
optional<string> str;
@@ -292,14 +293,14 @@ namespace {
if (str)
return string_value(*str);
else
- return string_value(empty_string);
+ return NULL_VALUE;
}
value_t get_pathname(item_t& item) {
if (item.pos)
return string_value(item.pos->pathname.string());
else
- return string_value(empty_string);
+ return NULL_VALUE;
}
value_t get_beg_pos(item_t& item) {