summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-16 03:54:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-16 03:54:50 -0400
commitf3b182ca8002e2fe604a2c93c7e3cde84179be56 (patch)
treebceeae5f0e9d634e00c76d20d9581a9369718ee4
parent0e54ef9c0876709297679398cc083c66e6084b81 (diff)
downloadfork-ledger-f3b182ca8002e2fe604a2c93c7e3cde84179be56.tar.gz
fork-ledger-f3b182ca8002e2fe604a2c93c7e3cde84179be56.tar.bz2
fork-ledger-f3b182ca8002e2fe604a2c93c7e3cde84179be56.zip
Patch from Nathan Jones so that trailing whitespace after account names in a
transaction with no amount is not parsed as a special name. Fixes #3.
-rw-r--r--textual.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/textual.cc b/textual.cc
index 4e899eea..17f08852 100644
--- a/textual.cc
+++ b/textual.cc
@@ -139,7 +139,8 @@ transaction_t * parse_transaction(char * line, account_t * account,
while (! in.eof()) {
in.get(p);
if (in.eof() || (std::isspace(p) &&
- (p == '\t' || std::isspace(in.peek()))))
+ (p == '\t' || in.peek() == EOF ||
+ std::isspace(in.peek()))))
break;
account_end++;
}