diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/scriptconfig.nim | 2 | ||||
-rw-r--r-- | compiler/vmops.nim | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 0c31eadbe..22377a1e2 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -79,7 +79,7 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string; setResult(a, osproc.execCmd getString(a, 0)) cbconf getEnv: - setResult(a, os.getEnv(a.getString 0)) + setResult(a, os.getEnv(a.getString 0, a.getString 1)) cbconf existsEnv: setResult(a, os.existsEnv(a.getString 0)) cbconf dirExists: diff --git a/compiler/vmops.nim b/compiler/vmops.nim index 38135951d..2a00f207a 100644 --- a/compiler/vmops.nim +++ b/compiler/vmops.nim @@ -47,6 +47,11 @@ template wrap1s_ospaths(op) {.dirty.} = setResult(a, op(getString(a, 0))) ospathsop op +template wrap2s_ospaths(op) {.dirty.} = + proc `op Wrapper`(a: VmArgs) {.nimcall.} = + setResult(a, op(getString(a, 0), getString(a, 1))) + ospathsop op + template wrap1s_system(op) {.dirty.} = proc `op Wrapper`(a: VmArgs) {.nimcall.} = setResult(a, op(getString(a, 0))) @@ -96,7 +101,7 @@ proc registerAdditionalOps*(c: PCtx) = wrap1f_math(ceil) wrap2f_math(fmod) - wrap1s_ospaths(getEnv) + wrap2s_ospaths(getEnv) wrap1s_ospaths(existsEnv) wrap1s_os(dirExists) wrap1s_os(fileExists) |