diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-20 18:03:35 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-20 18:03:35 -0500 |
commit | 8c18f66decdc1ab8b95a5057c2c8e752f009a631 (patch) | |
tree | e947fa854f4cc6d6cc9e572134ae1442174093b6 /src/times.cc | |
parent | aa086686ea2eb4efcb4684a48de8c15a97004a80 (diff) | |
download | fork-ledger-8c18f66decdc1ab8b95a5057c2c8e752f009a631.tar.gz fork-ledger-8c18f66decdc1ab8b95a5057c2c8e752f009a631.tar.bz2 fork-ledger-8c18f66decdc1ab8b95a5057c2c8e752f009a631.zip |
Don't rely on the integral value of a boolean
Diffstat (limited to 'src/times.cc')
-rw-r--r-- | src/times.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/times.cc b/src/times.cc index e3ccaff8..d4317509 100644 --- a/src/times.cc +++ b/src/times.cc @@ -1321,10 +1321,13 @@ date_parser_t::lexer_t::token_t date_parser_t::lexer_t::next_token() catch (...) {} } + start = begin; + string term; bool alnum = std::isalnum(*begin); - for (start = begin; (begin != end && ! std::isspace(*begin) && - alnum == std::isalnum(*begin)); begin++) + for (; (begin != end && ! std::isspace(*begin) && + ((alnum && static_cast<bool>(std::isalnum(*begin))) || + (! alnum && ! static_cast<bool>(std::isalnum(*begin))))); begin++) term.push_back(*begin); if (! term.empty()) { |