Skip to content

Commit 662f512

Browse files
committed
Shell: makes fish shell version detection more robust (v2)
1 parent fb91175 commit 662f512

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detection/terminalshell/terminalshell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static bool getShellVersionFish(FFstrbuf* exe, FFstrbuf* version)
8787
return false;
8888

8989
//fish, version 4.0.2-1 (Built by MSYS2 project) // version can be localized if LC_ALL is set
90-
if (!ffStrbufStartsWithS(version, "fish, ")) return false;
90+
if (version->length < strlen("fish, v") || !ffStrbufStartsWithS(version, "fish")) return false;
9191
uint32_t index = ffStrbufNextIndexC(version, strlen("fish, "), ' ');
9292
ffStrbufSubstrAfter(version, index);
9393
ffStrbufSubstrBeforeFirstC(version, ' ');

0 commit comments

Comments
 (0)