From 0403415607978641f3e996bc7f4052c721a1e5e8 Mon Sep 17 00:00:00 2001 From: dreamforceinc Date: Tue, 7 Nov 2023 17:48:53 +0300 Subject: [PATCH] Fix the git tagname parsing. --- wCenterWindow/updater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wCenterWindow/updater.cpp b/wCenterWindow/updater.cpp index b39c380..9b4f64d 100644 --- a/wCenterWindow/updater.cpp +++ b/wCenterWindow/updater.cpp @@ -5,6 +5,7 @@ #include "logger.h" #include "updater.h" #include "picojson.h" +#include #define GITHUB_URL TEXT("api.github.com") #define GITHUB_URI TEXT("/repos/dreamforceinc/wCenterWindow/releases/latest") @@ -78,7 +79,9 @@ DWORD WINAPI Updater(LPVOID) return 103; } - std::wstring gh_version = j_tag_name.substr(1); + size_t pos = 0; + while (std::iswdigit(j_tag_name.at(pos)) == 0) pos++; + std::wstring gh_version = j_tag_name.substr(pos); LOG_TO_FILE(L"[UPDT] %s(%d): AppVersion : %s", TEXT(__FUNCTION__), __LINE__, TEXT(VERSION_STR)); LOG_TO_FILE(L"[UPDT] %s(%d): GitVersion : %s", TEXT(__FUNCTION__), __LINE__, gh_version.c_str());