mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
Shell: be more robust on busybox version detection
This commit is contained in:
@@ -173,7 +173,14 @@ static bool extractBusyboxVersion(const char* line, uint32_t len, void* userdata
|
||||
return true;
|
||||
}
|
||||
|
||||
ffStrbufSetNS((FFstrbuf*) userdata, len - strlen("BusyBox v"), line + strlen("BusyBox v"));
|
||||
line += strlen("BusyBox v");
|
||||
len -= (uint32_t) strlen("BusyBox v");
|
||||
const char* space = memchr(line, ' ', len);
|
||||
if (space) {
|
||||
len = (uint32_t) (space - line);
|
||||
}
|
||||
|
||||
ffStrbufSetNS((FFstrbuf*) userdata, len, line);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user