From 8d0508a73cd984fa532ff9f29cbedba5d0e0aa81 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Fri, 16 Mar 2018 21:22:16 +0300 Subject: Use unsetenv instead of setenv with empty string --- src/feature/syncinstall.nim | 2 +- src/utils.nim | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim index 99da522..3d3abcc 100644 --- a/src/feature/syncinstall.nim +++ b/src/feature/syncinstall.nim @@ -327,7 +327,7 @@ proc buildLoop(config: Config, pkgInfos: seq[PackageInfo], noconfirm: bool, let buildCode = forkWait(proc: int = if chdir(buildPath) == 0: - discard setenv("MAKEPKG_CONF", "", 1) + discard unsetenv("MAKEPKG_CONF") if not noextract: removeDirQuiet(buildPath & "src") diff --git a/src/utils.nim b/src/utils.nim index 288cf44..c1146ae 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -158,6 +158,9 @@ proc runProgram*(args: varargs[string]): seq[string] = proc setenv*(name: cstring, value: cstring, override: cint): cint {.importc, header: "".} +proc unsetenv*(name: cstring): cint + {.importc, header: "".} + proc getUser*: (int, string) = let uid = getuid() while true: -- cgit v1.2.3-70-g09d2