summaryrefslogtreecommitdiff
path: root/scripts/context/stubs/mswin/mtxrun.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
committerHans Hagen <pragma@wxs.nl>2010-03-18 14:42:00 +0100
commit66a814af45f6ebe7ff0210238b2b9eba7dd3a499 (patch)
treec227b9351820db8c6084b82777c60b4367c80dd8 /scripts/context/stubs/mswin/mtxrun.lua
parentf8583123d8e264910387d015f4d6576551fe0ee4 (diff)
downloadcontext-66a814af45f6ebe7ff0210238b2b9eba7dd3a499.tar.gz
beta 2010.03.18 14:42
Diffstat (limited to 'scripts/context/stubs/mswin/mtxrun.lua')
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua22
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 447d958b2..2f203c3bc 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -8359,7 +8359,7 @@ function resolvers.getownpath()
if os.binsuffix ~= "" then
binary = file.replacesuffix(binary,os.binsuffix)
end
- for p in gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do
+ for p in gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do -- can be helper
local b = file.join(p,binary)
if lfs.isfile(b) then
-- we assume that after changing to the path the currentdir function
@@ -11801,8 +11801,24 @@ function runners.execute_script(fullname,internal,nosplit)
logs.simpleline()
io.flush()
end
- local code = os.exec(command) -- maybe spawn
- return code == 0
+ -- no os.exec because otherwise we get the wrong return value
+ local code = os.execute(command) -- maybe spawn
+ if code == 0 then
+ return true
+ else
+ if binary then
+ binary = file.addsuffix(binary,os.binsuffix)
+ for p in string.gmatch(os.getenv("PATH"),"[^"..io.pathseparator.."]+") do
+ if lfs.isfile(file.join(p,binary)) then
+ return false
+ end
+ end
+ logs.simpleline()
+ logs.simple("This script needs '%s' which seems not to be installed.",binary)
+ logs.simpleline()
+ end
+ return false
+ end
end
end
end