diff --git a/filesystem.hpp b/filesystem.hpp index 1c4a43e..16a58a4 100644 --- a/filesystem.hpp +++ b/filesystem.hpp @@ -22,6 +22,8 @@ namespace FSLib{ public: Iterator( const Directory &d_ ) : d(opendir(d_.path())) { current_entry = readdir(d); + if( current_entry != nullptr && ( !strcmp(current_entry->d_name, ".") || !strcmp(current_entry->d_name, "..") ) ) + ++(*this); } Iterator( const Directory &d_, const struct dirent *current_entry_) : d(opendir(d_.path())), current_entry(current_entry_) {}