From 0e6a00561cc7997ebb382f96d296bc84725ed91d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 15 Feb 2016 18:01:39 +0100 Subject: Add support for commenting ignore patterns file All lines starting with `#` are interpreted as comments --- src/tracking/path_matcher.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tracking/path_matcher.cc b/src/tracking/path_matcher.cc index e754586..c136565 100644 --- a/src/tracking/path_matcher.cc +++ b/src/tracking/path_matcher.cc @@ -15,9 +15,11 @@ PathMatcher::PathMatcher(const std::string& source_file_path) { std::string current_line; while ( std::getline(file, current_line) ) { - try { - this->patterns_.emplace_back(current_line); - } catch ( const std::regex_error& ) { } + if ( current_line[0] != '#' ) { // i.e. not a comment + try { + this->patterns_.emplace_back(current_line); + } catch ( const std::regex_error& ) { } + } } } } catch ( boost::filesystem::filesystem_error& ) { -- cgit v1.2.3