Skip to content

Commit

Permalink
Merge branch 'branch_2.7.x' into no_last_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Edrusb committed Jul 8, 2024
2 parents b41baf4 + ae06fdc commit df9e024
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/build/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ from 2.7.x to 2.8.0
than the last slice to fetch archive format when reading an archive with
the help of an external catalog in direct access mode.

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.
Expand Down
10 changes: 6 additions & 4 deletions src/dar_suite/line_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,17 +1614,19 @@ string line_tools_build_regex_for_exclude_mask(const string & prefix,
string result = "^";
string::const_iterator it = prefix.begin();

// prepending any non alpha numeric char of the root by a anti-slash
// prepending any regex specific char of the root by a anti-slash

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
Expand Down

0 comments on commit df9e024

Please sign in to comment.