From 45e55834ea298081786707cb0bff92c3572e98b8 Mon Sep 17 00:00:00 2001 From: Martin Garcia Date: Thu, 26 May 2022 14:19:35 +0200 Subject: [PATCH] Fix ignored hidden files --- src/printnode.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/printnode.cpp b/src/printnode.cpp index f117b23..2f9080f 100644 --- a/src/printnode.cpp +++ b/src/printnode.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "printnode.hpp" #include "crc32.hpp" @@ -77,7 +78,10 @@ void print_node( ostream & output, const string & base, const string & system_pa DIR * d = opendir( fullpath.c_str() ); struct dirent * dir; while ( ( dir = readdir( d ) ) != NULL ) { - if ( dir->d_name[0] != '.' ) { + if ( + !(dir->d_name[0] == '.' && strlen(dir->d_name) == 1) && // Is not itself "." + !(strlen(dir->d_name) == 2 && dir->d_name[0] == '.' && dir->d_name[1] == '.') // Is not parent directory ".." + ) { string new_path(path); new_path += string( "/" ) + string( dir->d_name ); #if defined(WINDOWS)