use qi - parser to work with 0 speed file lines

This commit is contained in:
karenzshea 2017-02-13 14:52:50 +01:00 committed by Patrick Niklaus
parent 23b07c9197
commit 1bace1288d
2 changed files with 9 additions and 1 deletions

View File

@ -28,3 +28,11 @@ Feature: osrm-contract command line options: datasources
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then datasource names should contain "lua profile,27_osrmcontract_passing_base_file_speeds"
And it should exit successfully
Scenario: osrm-contract - Passing base file
Given the speed file
"""
"""
And the data has been extracted
When I run "osrm-contract --segment-speed-file {speeds_file} {processed_file}"
Then it should exit successfully

View File

@ -268,7 +268,7 @@ template <typename Key, typename Value> struct CSVFilesParser
qi::rule<Iterator, std::pair<Key, Value>()> csv_line =
(key_rule >> ',' >> value_source) >> -(',' >> *(qi::char_ - qi::eol));
std::vector<std::pair<Key, Value>> result;
const auto ok = qi::parse(first, last, (csv_line % qi::eol) >> *qi::eol, result);
const auto ok = qi::parse(first, last, -(csv_line % qi::eol) >> *qi::eol, result);
if (!ok || first != last)
{