1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-06 01:30:40 +03:00

Cedar: Trim contiguous whitespaces in version string

Before change, contiguous whitespaces appeared in version string.
This room is for beta string (such as Alpha, Beta) and beta number but
it looks a bit odd if the build is not alpha/beta/RC.

> Version 5.02 Build 5180 Alpha 3 (Japanese)
> Version 5.02 Build 5180 Beta 3 (Japanese)
> Version 5.02 Build 5180 Release Candidate 3 (Japanese)
> Version 5.02 Build 5180   (Japanese)
>                        ^^^

Now version string looks neat like this:

> Version 5.02 Build 5180 (Japanese)
> Version 5.02 Build 5180 Release Candidate 3 (Japanese)
This commit is contained in:
Koichiro IWAO 2023-02-28 22:06:49 +09:00
parent 8c64dc0cd7
commit 1fe26ccb6c
No known key found for this signature in database
GPG Key ID: 03993B4065E7193B

View File

@ -1564,10 +1564,13 @@ CEDAR *NewCedar(X *server_x, K *server_k)
#endif // ALPHA_VERSION
ToStr(tmp2, c->Beta);
Format(tmp2, sizeof(tmp2), " %s %s ", beta_str, tmp2);
Format(tmp, sizeof(tmp), "Version %u.%02u Build %u %s %s (%s)",
Format(tmp, sizeof(tmp),
"Version %u.%02u Build %u"
"%s" // Alpha, Beta, Release Candidate or nothing
"(%s)", // Language
CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD,
c->Beta == 0 ? "" : beta_str,
c->Beta == 0 ? " " : tmp2,
_SS("LANGSTR"));
Trim(tmp);