mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-18 20:51:45 +00:00
control/controlclient: deal with localized 'Version' string getting Windows version
This commit is contained in:
parent
4f7751e025
commit
662c19551a
@ -21,6 +21,10 @@ func osVersionWindows() string {
|
|||||||
s := strings.TrimSpace(string(out))
|
s := strings.TrimSpace(string(out))
|
||||||
s = strings.TrimPrefix(s, "Microsoft Windows [")
|
s = strings.TrimPrefix(s, "Microsoft Windows [")
|
||||||
s = strings.TrimSuffix(s, "]")
|
s = strings.TrimSuffix(s, "]")
|
||||||
s = strings.TrimPrefix(s, "Version ") // is this localized? do it last in case.
|
|
||||||
|
// "Version 10.x.y.z", with "Version" localized. Keep only stuff after the space.
|
||||||
|
if sp := strings.Index(s, " "); sp != -1 {
|
||||||
|
s = s[sp+1:]
|
||||||
|
}
|
||||||
return s // "10.0.19041.388", ideally
|
return s // "10.0.19041.388", ideally
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user