aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/elevate/doas.go
diff options
context:
space:
mode:
Diffstat (limited to 'elevate/doas.go')
-rw-r--r--elevate/doas.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/elevate/doas.go b/elevate/doas.go
index da692b20..b67ee88c 100644
--- a/elevate/doas.go
+++ b/elevate/doas.go
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT
*
- * Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
+ * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
*/
package elevate
@@ -19,11 +19,11 @@ import (
func setAllEnv(env []string) {
windows.Clearenv()
for _, e := range env {
- kv := strings.SplitN(e, "=", 2)
- if len(kv) != 2 {
+ k, v, ok := strings.Cut(e, "=")
+ if !ok {
continue
}
- windows.Setenv(kv[0], kv[1])
+ windows.Setenv(k, v)
}
}