mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Shell: improves fish version detection for newer fish version
This commit is contained in:
@@ -89,7 +89,14 @@ static bool getShellVersionFish(FFstrbuf* exe, FFstrbuf* version) {
|
||||
if (version->length < strlen("fish, v") || !ffStrbufStartsWithS(version, "fish")) {
|
||||
return false;
|
||||
}
|
||||
uint32_t index = ffStrbufNextIndexC(version, strlen("fish, "), ' ');
|
||||
uint32_t index = ffStrbufFirstIndexC(version, ' '); // skip "fish,"
|
||||
while (index + 1 < version->length && !ffCharIsDigit(version->chars[index + 1])) {
|
||||
index = ffStrbufNextIndexC(version, index + 1, ' '); // skip "version"
|
||||
}
|
||||
if (index + 1 >= version->length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ffStrbufSubstrAfter(version, index);
|
||||
ffStrbufSubstrBeforeFirstC(version, ' ');
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user