1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: remove private unix_environ() helper function, it is not needed anymore (#15654)

This commit is contained in:
jrfondren 2022-09-04 05:22:38 -05:00 committed by GitHub
parent 0c84ad847e
commit 45e21bc311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,11 +79,6 @@ pub fn unsetenv(name string) int {
// See: https://docs.microsoft.com/bg-bg/windows/win32/api/processenv/nf-processenv-getenvironmentstrings
// os.environ returns a map of all the current environment variables
fn unix_environ() &&char {
// TODO: remove this helper function, when `&&char(C.environ)` works properly
return voidptr(C.environ)
}
pub fn environ() map[string]string {
mut res := map[string]string{}
$if windows {
@ -101,7 +96,7 @@ pub fn environ() map[string]string {
}
C.FreeEnvironmentStringsW(estrings)
} $else {
start := unix_environ()
start := &&char(C.environ)
mut i := 0
for {
x := unsafe { start[i] }