From 4510ef7e1c5c834d90e9647303046599b39cee52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 18 Nov 2023 16:24:23 +0800 Subject: [PATCH] Shell (Windows): tidy --- src/detection/terminalshell/terminalshell.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 0fe89f3aa..d54e1cc61 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -153,17 +153,14 @@ static bool getShellVersionNushell(FFstrbuf* exe, FFstrbuf* version) #ifdef _WIN32 static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version) { - if(ffProcessAppendStdOut(version, (char* const[]) { + return ffProcessAppendStdOut(version, (char* const[]) { exe->chars, "-NoLogo", "-NoProfile", "-Command", "$PSVersionTable.PSVersion.ToString()", NULL - })) return false; - - ffStrbufSubstrAfterLastC(version, ' '); - return true; + }) == NULL; } #endif