Shell: fixes the fast path of ash version detection

This commit is contained in:
Carter Li
2026-08-26 08:50:08 +08:00
parent 1b1df2e731
commit 3b76ade662
@@ -194,6 +194,9 @@ static bool extractBusyboxVersion(const char* line, uint32_t len, void* userdata
static bool getShellVersionAsh(FFstrbuf* exe, FFstrbuf* version) {
ffBinaryExtractStrings(exe->chars, extractBusyboxVersion, version, (uint32_t) strlen("BusyBox v0.0.0"));
if (version->length > 0) {
return true;
}
const char* error = ffStrbufEndsWithS(exe, "busybox")
? ffProcessAppendStdErr(version, (char* const[]) { exe->chars, "ash", "--help", nullptr })