Chore: strcasecmp => ffStrEqualsIgnCase

This commit is contained in:
李通洲
2024-06-03 14:17:01 +08:00
parent d860ce528a
commit 0b75caaf96
5 changed files with 53 additions and 53 deletions
+3 -3
View File
@@ -43,11 +43,11 @@ static bool detectPlasmaFromFile(const char* filename, FFQtResult* result)
char categoryName[32];
sscanf(line, "[%31[^]]", categoryName);
if(strcasecmp(categoryName, "General") == 0)
if(ffStrEqualsIgnCase(categoryName, "General"))
category = PLASMA_CATEGORY_GENERAL;
else if(strcasecmp(categoryName, "KDE") == 0)
else if(ffStrEqualsIgnCase(categoryName, "KDE"))
category = PLASMA_CATEGORY_KDE;
else if(strcasecmp(categoryName, "Icons") == 0)
else if(ffStrEqualsIgnCase(categoryName, "Icons"))
category = PLASMA_CATEGORY_ICONS;
else
category = PLASMA_CATEGORY_OTHER;
+1 -1
View File
@@ -17,7 +17,7 @@ static uint32_t getNumElements(const char* searchPath /* including `\*` suffix *
do // Managed to locate and create an handle to that folder.
{
if(!(wfd.dwFileAttributes & type)) continue;
if(!flag && strcasecmp(ignore, wfd.cFileName) == 0)
if(!flag && ffStrEqualsIgnCase(ignore, wfd.cFileName))
{
flag = true;
continue;
+13 -13
View File
@@ -231,33 +231,33 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
if(ffStrEqualsIgnCase(exeName, "sh")) // #849
return false;
if(strcasecmp(exeName, "bash") == 0)
if(ffStrEqualsIgnCase(exeName, "bash"))
return getShellVersionBash(exe, version);
if(strcasecmp(exeName, "zsh") == 0)
if(ffStrEqualsIgnCase(exeName, "zsh"))
return getExeVersionGeneral(exe, version); //zsh 5.9 (arm-apple-darwin21.3.0)
if(strcasecmp(exeName, "fish") == 0)
if(ffStrEqualsIgnCase(exeName, "fish"))
return getShellVersionFish(exe, version);
if(strcasecmp(exeName, "pwsh") == 0)
if(ffStrEqualsIgnCase(exeName, "pwsh"))
return getShellVersionPwsh(exe, version);
if(strcasecmp(exeName, "csh") == 0 || strcasecmp(exeName, "tcsh") == 0)
if(ffStrEqualsIgnCase(exeName, "csh") || ffStrEqualsIgnCase(exeName, "tcsh"))
return getExeVersionGeneral(exe, version); //tcsh 6.24.07 (Astron) 2022-12-21 (aarch64-apple-darwin) options wide,nls,dl,al,kan,sm,rh,color,filec
if(strcasecmp(exeName, "nu") == 0)
if(ffStrEqualsIgnCase(exeName, "nu"))
return getShellVersionNushell(exe, version);
if(strcasecmp(exeName, "ksh") == 0)
if(ffStrEqualsIgnCase(exeName, "ksh"))
return getShellVersionKsh(exe, version);
if(strcasecmp(exeName, "oksh") == 0)
if(ffStrEqualsIgnCase(exeName, "oksh"))
return getShellVersionOksh(exe, version);
if(strcasecmp(exeName, "oil.ovm") == 0)
if(ffStrEqualsIgnCase(exeName, "oil.ovm"))
return getShellVersionOils(exe, version);
if(strcasecmp(exeName, "elvish") == 0)
if(ffStrEqualsIgnCase(exeName, "elvish"))
return getExeVersionRaw(exe, version);
if(strcasecmp(exeName, "ash") == 0)
if(ffStrEqualsIgnCase(exeName, "ash"))
return getShellVersionAsh(exe, version);
if(strcasecmp(exeName, "xonsh") == 0)
if(ffStrEqualsIgnCase(exeName, "xonsh"))
return getShellVersionXonsh(exe, version);
#ifdef _WIN32
if(strcasecmp(exeName, "powershell") == 0 || strcasecmp(exeName, "powershell_ise") == 0)
if(ffStrEqualsIgnCase(exeName, "powershell") || ffStrEqualsIgnCase(exeName, "powershell_ise"))
return getShellVersionWinPowerShell(exe, version);
return getFileVersion(exe->chars, version);