summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorLevin Du <zslevin@gmail.com>2008-07-29 17:37:35 +0800
committerLevin Du <zslevin@gmail.com>2008-07-29 17:37:35 +0800
commitbffdc6431d86a3f483c1fc2708526cae28d39f4b (patch)
tree34dfd63a90f15160c65799ee185ad71516d4d009 /textual.cc
parent7dfa17b2602a424ab0d8f137ea0fc9005cdf8f84 (diff)
downloadfork-ledger-bffdc6431d86a3f483c1fc2708526cae28d39f4b.tar.gz
fork-ledger-bffdc6431d86a3f483c1fc2708526cae28d39f4b.tar.bz2
fork-ledger-bffdc6431d86a3f483c1fc2708526cae28d39f4b.zip
fix beg_line bug
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/textual.cc b/textual.cc
index 9ac018fa..46d6d8aa 100644
--- a/textual.cc
+++ b/textual.cc
@@ -509,7 +509,7 @@ entry_t * parse_entry(std::istream& in, char * line, account_t * master,
TIMER_START(entry_xacts);
unsigned long end_pos;
- unsigned long beg_line = linenum;
+ unsigned long beg_line;
while (! in.eof() && (in.peek() == ' ' || in.peek() == '\t')) {
unsigned long beg_pos = (unsigned long)in.tellg();
@@ -524,6 +524,7 @@ entry_t * parse_entry(std::istream& in, char * line, account_t * master,
line[--len] = '\0';
end_pos = beg_pos + len + 1;
+ beg_line = linenum;
linenum++;
if (line[0] == ' ' || line[0] == '\t') {
@@ -698,7 +699,7 @@ unsigned int textual_parser_t::parse(std::istream& in,
unsigned long beg_pos = in.tellg();
unsigned long end_pos;
- unsigned long beg_line = linenum;
+ unsigned long beg_line;
while (in.good() && ! in.eof()) {
try {
@@ -711,6 +712,7 @@ unsigned int textual_parser_t::parse(std::istream& in,
line[--len] = '\0';
end_pos = beg_pos + len + 1;
+ beg_line = linenum;
linenum++;
switch (line[0]) {
@@ -951,7 +953,6 @@ unsigned int textual_parser_t::parse(std::istream& in,
}
default: {
- unsigned int first_line = linenum;
unsigned long pos = beg_pos;
if (entry_t * entry =
parse_entry(in, line, account_stack.front(), *this, pos)) {