From 8c18f66decdc1ab8b95a5057c2c8e752f009a631 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 20 Nov 2009 18:03:35 -0500 Subject: Don't rely on the integral value of a boolean --- src/times.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/times.cc') 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(std::isalnum(*begin))) || + (! alnum && ! static_cast(std::isalnum(*begin))))); begin++) term.push_back(*begin); if (! term.empty()) { -- cgit v1.2.3