Shell: be more robust on busybox version detection

This commit is contained in:
李通洲
2026-06-03 18:29:10 +08:00
parent 8dd38f5744
commit 723552f68b
+8 -1
View File
@@ -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;
}