Shell (Windows): fallback shell version detection to file version

This commit is contained in:
李通洲
2023-07-04 18:00:50 +08:00
parent c6416b5ccb
commit 41cef6274c
+3 -8
View File
@@ -122,11 +122,6 @@ static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version)
ffStrbufSubstrAfterLastC(version, ' ');
return true;
}
static bool getShellVersionCmd(FFstrbuf* exe, FFstrbuf* version)
{
return getFileVersion(exe->chars, version);
}
#endif
bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
@@ -152,11 +147,11 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
#ifdef _WIN32
if(strcasecmp(exeName, "powershell") == 0 || strcasecmp(exeName, "powershell_ise") == 0)
return getShellVersionWinPowerShell(exe, version);
if(strcasecmp(exeName, "cmd") == 0)
return getShellVersionCmd(exe, version);
#endif
return getFileVersion(exe->chars, version);
#else
return false;
#endif
}
FF_MAYBE_UNUSED static bool getTerminalVersionTermux(FFstrbuf* version)