+ std::string::iterator seq_i = seq.begin();
+ std::string::iterator seq_end = seq.end();
+
+ // this if block is a hack, for some reason spirit was
+ // duplicating the last character if the file didn't end
+ // with a new line.
+ // this checks for the trailing newline, and if it is missing
+ // removes the last character ( which should be the duplicated character.
+ // check test_sequence.cpp:sequence_no_trailing_newline for test case
+ // also see ticket:265 for more information
+ if (seq.size() > 0) {
+ std::string::value_type c = seq[seq.size()-1];
+ if (not (c == '\015' or c == '\012')) {
+ // doesn't end with a new line character
+ seq_end--;
+ }
+ }
+ // end hack
+