mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-30 08:48:12 +00:00
fix(ui): keep pre-release suffix in splash-screen firmware version
All three UI variants stripped the displayed version at the FIRST dash, assuming it was always the commit-hash separator build.sh appends. A tag containing its own dash (e.g. v1.21-rc1) has that dash earlier, so the splash screen silently dropped "-rc1" and showed just "v1.21" — no way to tell an RC from the final release on-device. Strip at the LAST dash instead, since build.sh always appends the commit hash as the final segment regardless of how many dashes the tag itself has. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,10 +39,11 @@ class SplashScreen : public UIScreen {
|
||||
|
||||
public:
|
||||
SplashScreen(UITask* task) : _task(task) {
|
||||
// strip off dash and commit hash by changing dash to null terminator
|
||||
// e.g: v1.2.3-abcdef -> v1.2.3
|
||||
// strip off the commit-hash suffix build.sh always appends as the LAST
|
||||
// dash-segment, e.g: v1.2.3-abcdef -> v1.2.3, v1.21-rc1-abcdef -> v1.21-rc1
|
||||
// (must use the last dash, not the first, since a tag itself may contain one)
|
||||
const char *ver = FIRMWARE_VERSION;
|
||||
const char *dash = strchr(ver, '-');
|
||||
const char *dash = strrchr(ver, '-');
|
||||
|
||||
int len = dash ? dash - ver : strlen(ver);
|
||||
if (len >= sizeof(_version_info)) len = sizeof(_version_info) - 1;
|
||||
|
||||
Reference in New Issue
Block a user