mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
Chore (Linux): always ignore hidden files when enumerating directories
This commit is contained in:
@@ -167,7 +167,7 @@ const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
FF_AUTO_CLOSE_FD int dfd = openat(dirfd(dirp), entry->d_name, O_RDONLY | O_CLOEXEC);
|
||||
|
||||
@@ -25,7 +25,7 @@ static const char* detectWithBacklight(FFlist* result)
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
ffStrbufAppendS(&backlightDir, entry->d_name);
|
||||
|
||||
@@ -22,7 +22,7 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
ffStrbufAppendS(&drmDir, entry->d_name);
|
||||
@@ -185,7 +185,7 @@ FF_MAYBE_UNUSED static const char* drmGetEdidByConnId(uint32_t connId, uint8_t*
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
ffStrbufAppendS(&drmDir, entry->d_name);
|
||||
|
||||
@@ -610,7 +610,7 @@ static void getPackageCountsBedrock(FFstrbuf* baseDir, FFPackagesResult* package
|
||||
{
|
||||
if(entry->d_type != DT_DIR)
|
||||
continue;
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
ffStrbufAppendS(baseDir, entry->d_name);
|
||||
|
||||
@@ -63,7 +63,7 @@ const char* ffDetectPowerAdapter(FFlist* results)
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
{
|
||||
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
|
||||
if(entry->d_name[0] == '.')
|
||||
continue;
|
||||
|
||||
FF_AUTO_CLOSE_FD int dfd = openat(dirfd(dirp), entry->d_name, O_RDONLY | O_CLOEXEC);
|
||||
|
||||
Reference in New Issue
Block a user