Commit 921dc1ad authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

fs: win32: Ignore hidden folders

Even though this isn't the standard way of hidding folders on windows,
we don't need to care about "." and "..", and this will avoid parsing
unrequired files when browsing an msys/cygwin folder
parent 00f5421e
......@@ -54,10 +54,13 @@ void Directory::read() const
throw std::runtime_error( "Failed to browse through " + m_path );
do
{
auto file = charset::FromWide( f.cFileName );
if ( file[0] == '.' )
continue;
if ( ( f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) != 0 )
m_dirs.emplace_back( m_fsFactory.createDirectory( charset::FromWide( f.cFileName ).get() ) );
m_dirs.emplace_back( m_fsFactory.createDirectory( file.get() ) );
else
m_files.emplace_back( std::make_shared<File>( charset::FromWide( f.cFileName ).get() ) );
m_files.emplace_back( std::make_shared<File>( file.get() ) );
} while ( FindNextFile( h, &f ) != 0 );
FindClose( h );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment