summaryrefslogtreecommitdiff
path: root/parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'parse.cc')
-rw-r--r--parse.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/parse.cc b/parse.cc
index 749e3cbd..579bc432 100644
--- a/parse.cc
+++ b/parse.cc
@@ -8,12 +8,7 @@
namespace ledger {
-//////////////////////////////////////////////////////////////////////
-//
-// Ledger parser
-//
-
-char * next_element(char * buf, bool variable = false)
+static char * next_element(char * buf, bool variable = false)
{
char * p;
@@ -34,7 +29,8 @@ char * next_element(char * buf, bool variable = false)
static int linenum = 0;
-inline void finalize_entry(entry * curr) {
+static inline void finalize_entry(entry * curr)
+{
if (curr) {
if (! curr->validate()) {
std::cerr << "Failed to balance the following transaction, "
@@ -46,6 +42,11 @@ inline void finalize_entry(entry * curr) {
}
}
+//////////////////////////////////////////////////////////////////////
+//
+// Ledger parser
+//
+
bool parse_ledger(std::istream& in)
{
static std::time_t now = std::time(NULL);
@@ -150,6 +151,7 @@ bool parse_ledger(std::istream& in)
// If there is no amount given, it is intended as an implicit
// amount; we must use the opposite of the value of the
// preceding transaction.
+
if (! cost_str || *cost_str == ';') {
if (cost_str) {
while (*cost_str == ';' || std::isspace(*cost_str))