Skip to content

Commit

Permalink
Fix #62 - sub-subdirectory sync with -s
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed May 10, 2016
1 parent 40e33cb commit 62e2611
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libgrive/src/base/State.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ State::State( const fs::path& filename, const Val& options ) :
{
// "-s" is internally converted to an ignore regexp
const boost::regex esc( "[.^$|()\\[\\]{}*+?\\\\]" );
std::string ign = "^(?!"+regex_replace( m_dir, esc, "\\\\&", boost::format_sed )+"(/|$))";
m_dir = regex_replace( m_dir, esc, "\\\\&", boost::format_sed );
size_t pos = 0;
while ( ( pos = m_dir.find( '/', pos ) ) != std::string::npos )
{
m_dir = m_dir.substr( 0, pos ) + "$|" + m_dir;
pos = pos*2 + 3;
}
std::string ign = "^(?!"+m_dir+"(/|$))";
m_ign = ign;
}
}
Expand Down

0 comments on commit 62e2611

Please sign in to comment.