Global: refactor strcmp() == 0 to ffStrEquals()

This commit is contained in:
李通洲
2023-06-19 16:07:23 +08:00
parent da76c6efbe
commit baa8992322
15 changed files with 174 additions and 168 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
#include "io.h"
#include "util/stringUtils.h"
#include <fcntl.h>
#include <sys/stat.h>
@@ -194,7 +195,7 @@ void listFilesRecursively(FFstrbuf* folder, uint8_t indentation, const char* fol
{
if(entry->d_type == DT_DIR)
{
if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
if(ffStrEquals(entry->d_name, ".") || ffStrEquals(entry->d_name, ".."))
continue;
ffStrbufAppendS(folder, entry->d_name);
+2 -1
View File
@@ -1,4 +1,5 @@
#include "io.h"
#include "util/stringUtils.h"
static void createSubfolders(const char* fileName)
{
@@ -118,7 +119,7 @@ void listFilesRecursively(FFstrbuf* folder, uint8_t indentation, const char* fol
{
if (entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if(strcmp(entry.cFileName, ".") == 0 || strcmp(entry.cFileName, "..") == 0)
if(ffStrEquals(entry.cFileName, ".") || ffStrEquals(entry.cFileName, ".."))
continue;
ffStrbufSubstrBefore(folder, folderLength);