From fb9117553b164356fe268cc1a221016f43362cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 11 Nov 2025 15:19:40 +0800 Subject: [PATCH] Shell: makes fish shell version detection more robust --- src/detection/terminalshell/terminalshell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index d081e2993..a6a40834c 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -87,7 +87,7 @@ static bool getShellVersionFish(FFstrbuf* exe, FFstrbuf* version) return false; //fish, version 4.0.2-1 (Built by MSYS2 project) // version can be localized if LC_ALL is set - if (version->length < strlen("fish, v")) return false; + if (!ffStrbufStartsWithS(version, "fish, ")) return false; uint32_t index = ffStrbufNextIndexC(version, strlen("fish, "), ' '); ffStrbufSubstrAfter(version, index); ffStrbufSubstrBeforeFirstC(version, ' ');