Fix #62 - sub-subdirectory sync with -s

issue-71
Vitaliy Filippov 2016-05-10 23:10:41 +03:00
parent 40e33cb524
commit 62e26118f2
1 changed files with 8 additions and 1 deletions

View File

@ -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;
}
}