summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/ledger3.texi14
-rw-r--r--src/global.cc4
-rw-r--r--src/output.cc25
3 files changed, 21 insertions, 22 deletions
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index c724316e..cecb317e 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -179,7 +179,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ledger is a command-line accounting tool that provides double-entry
accounting based on a text journal. It provides no bells or whistles,
and returns the user to the days before user interfaces were even a
-twinkling in their father's CRT.
+twinkling in their fathers' CRTs.
@end ifnottex
@@ -3056,7 +3056,7 @@ used as the payee name for that posting. This affects the
This is useful when for example you deposit 4 checks at a time to the
bank. On the bank statement, there is just one amount @samp{$400}, but
-you can specify from whom each check came from, as shown by example
+you can specify from whom each check came, as shown by example
below:
@smallexample @c input:9B43E57
@@ -3505,7 +3505,7 @@ But this does not do what you might expect:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ $50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
2012-04-10 My Broker
Assets:Brokerage:Cash $375.00
@@ -3531,11 +3531,11 @@ following two transactions are equivalent:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ $50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @{$50.00@}
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
However, note that what you see in some reports may differ, for
@@ -3554,7 +3554,7 @@ at the time of a transaction. This is done using @samp{@{=AMOUNT@}}:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @{=$50.00@}
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
These 10 AAPL will now always be reported as being worth $50, no
@@ -3570,7 +3570,7 @@ fixated prices by way of the cost:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ =$50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
This is the same as the previous transaction, with the same caveats
diff --git a/src/global.cc b/src/global.cc
index b1c45d45..37765a9b 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -136,9 +136,7 @@ void global_scope_t::read_init()
path init_file;
if (HANDLED(init_file_)) {
init_file=HANDLER(init_file_).str();
- if (exists(init_file)) {
- parse_init(init_file);
- } else {
+ if (!exists(init_file)) {
throw_(parse_error, _f("Could not find specified init file %1%") % init_file);
}
} else {
diff --git a/src/output.cc b/src/output.cc
index c6c8ecd7..2a8c8201 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -332,18 +332,19 @@ void report_tags::flush()
void report_tags::gather_metadata(item_t& item)
{
- if (item.metadata)
- foreach (const item_t::string_map::value_type& data, *item.metadata) {
- string tag(data.first);
- if (report.HANDLED(values) && data.second.first)
- tag += ": " + data.second.first.get().to_string();
-
- std::map<string, std::size_t>::iterator i = tags.find(tag);
- if (i == tags.end())
- tags.insert(tags_pair(tag, 1));
- else
- (*i).second++;
- }
+ if (! item.metadata)
+ return;
+ foreach (const item_t::string_map::value_type& data, *item.metadata) {
+ string tag(data.first);
+ if (report.HANDLED(values) && data.second.first)
+ tag += ": " + data.second.first.get().to_string();
+
+ std::map<string, std::size_t>::iterator i = tags.find(tag);
+ if (i == tags.end())
+ tags.insert(tags_pair(tag, 1));
+ else
+ (*i).second++;
+ }
}
void report_tags::operator()(post_t& post)