diff --git a/src/build/ChangeLog b/src/build/ChangeLog index c52c8f18..000bd265 100644 --- a/src/build/ChangeLog +++ b/src/build/ChangeLog @@ -29,6 +29,10 @@ from 2.7.x to 2.8.0 - exposing build_regex_for_exclude_mask() routine in tools module (was cli specific in line_tools module). +from 2.7.15 to 2.7.16 +- fixed mask building of path exclusion (dar's -P option) when used with + regular expression (problem met while testing or merging a backup) + from 2.7.14 to 2.7.15 - updating libdar about CURLINFO_CONTENT_LENGTH_DOWNLOAD symbol which is reported as deprecated by recent libcurl libraries. diff --git a/src/libdar/tools.cpp b/src/libdar/tools.cpp index 4bb47bcf..0d7bf091 100644 --- a/src/libdar/tools.cpp +++ b/src/libdar/tools.cpp @@ -2407,13 +2407,15 @@ namespace libdar for( ; it != prefix.end() ; ++it) { - if(isalnum(*it) || *it == '/' || *it == ' ') - result += *it; - else + if(*it == '.' || *it == '?' || *it == '+' || *it == '*' || + *it == '^' || *it == '$' || *it == '[' || *it == '|' || + *it == '{' || *it == '(' || *it == ')' || *it == '\\') { result += '\\'; result += *it; } + else + result += *it; } // adding a trailing / if necessary