|
Boost-Commit : |
From: hartmut.kaiser_at_[hidden]
Date: 2008-04-20 11:27:31
Author: hkaiser
Date: 2008-04-20 11:27:30 EDT (Sun, 20 Apr 2008)
New Revision: 44637
URL: http://svn.boost.org/trac/boost/changeset/44637
Log:
Spirit.Qi: Fixed eol parser
Text files modified:
trunk/boost/spirit/home/qi/char/primitives.hpp | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
Modified: trunk/boost/spirit/home/qi/char/primitives.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/char/primitives.hpp (original)
+++ trunk/boost/spirit/home/qi/char/primitives.hpp 2008-04-20 11:27:30 EDT (Sun, 20 Apr 2008)
@@ -34,19 +34,24 @@
{
qi::skip(first, last, skipper);
+ Iterator it = first;
+
bool matched = false;
- if (first != last && *first == '\r') // CR
+ if (it != last && *it == '\r') // CR
{
matched = true;
- ++first;
+ ++it;
}
- if (first != last && *first == '\n') // LF
+ if (it != last && *it == '\n') // LF
{
matched = true;
- ++first;
+ ++it;
}
-
- return matched;
+ if (!matched)
+ return false;
+
+ first = it;
+ return true;
}
template <typename Component>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk