diff options
author | Adrian Kummerlaender | 2016-02-15 18:01:39 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2016-02-15 18:01:39 +0100 |
commit | 0e6a00561cc7997ebb382f96d296bc84725ed91d (patch) | |
tree | cdb028295acdd897695fc6644850aefaec08ffb5 /src/tracking | |
parent | 1ffaf37388cd691e88196b6e00455eda0e652cf0 (diff) | |
download | change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar.gz change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar.bz2 change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar.lz change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar.xz change-0e6a00561cc7997ebb382f96d296bc84725ed91d.tar.zst change-0e6a00561cc7997ebb382f96d296bc84725ed91d.zip |
Add support for commenting ignore patterns file
All lines starting with `#` are interpreted as comments
Diffstat (limited to 'src/tracking')
-rw-r--r-- | src/tracking/path_matcher.cc | 8 |
1 files 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& ) { |