From 072d5131b49ff64de40d1c9e44a0abcf3b0f1d73 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 8 Oct 2003 23:05:15 +0000 Subject: *** empty log message *** --- parse.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'parse.cc') diff --git a/parse.cc b/parse.cc index 88042828..538b6ff4 100644 --- a/parse.cc +++ b/parse.cc @@ -24,7 +24,11 @@ static inline char * next_element(char * buf, bool variable = false) *p = '\0'; return skip_ws(p + 1); } - else if (*(p + 1) == ' ' || *(p + 1) == '\t') { + else if (*p == '\t') { + *p = '\0'; + return skip_ws(p + 1); + } + else if (*(p + 1) == ' ') { *p = '\0'; return skip_ws(p + 2); } @@ -407,7 +411,7 @@ void parse_automated_transactions(std::istream& in, book * ledger) { static char line[MAX_LINE + 1]; - std::list * masks = NULL; + regexps_map * masks = NULL; while (! in.eof() && in.peek() == '=') { in.getline(line, MAX_LINE); @@ -417,8 +421,8 @@ void parse_automated_transactions(std::istream& in, book * ledger) p = skip_ws(p); if (! masks) - masks = new std::list; - masks->push_back(mask(p)); + masks = new regexps_map; + masks->push_back(new mask(p)); } std::list * xacts = NULL; @@ -490,7 +494,7 @@ book * parse_ledger(std::istream& in, regexps_map& regexps, linenum++; // Add the regexp to whatever masks currently exist - regexps.push_back(mask(line)); + regexps.push_back(new mask(line)); break; case '=': // automated transactions -- cgit v1.2.3