From 41cef6274c4fd6c770f83c391e915120066da3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 4 Jul 2023 18:00:50 +0800 Subject: [PATCH] Shell (Windows): fallback shell version detection to file version --- src/detection/terminalshell/terminalshell.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 43cda6746..96f63bbbf 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -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)