diff options
Diffstat (limited to 'scripts/context/lua/mtx-plain.lua')
-rw-r--r-- | scripts/context/lua/mtx-plain.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/context/lua/mtx-plain.lua b/scripts/context/lua/mtx-plain.lua index de62b19ea..949b57952 100644 --- a/scripts/context/lua/mtx-plain.lua +++ b/scripts/context/lua/mtx-plain.lua @@ -55,7 +55,9 @@ end local function resultof(...) local command = string.format(...) report("running command %a",command) - return string.strip(os.resultof(command) or "") + local result = os.resultof(command) or "" + result = string.gsub(result,"[\n\r]+","") + return result end function scripts.plain.make(texengine,texformat) @@ -64,13 +66,13 @@ function scripts.plain.make(texengine,texformat) local fmtpathspec = resultof("kpsewhich --var-value=TEXFORMATS --engine=%s",texengine) if fmtpathspec ~= "" then report("using path specification %a",fmtpathspec) - fmtpathspec = resultof('kpsewhich -expand-braces="%s"',fmtpathspec) + fmtpathspec = resultof('kpsewhich --expand-braces="%s"',fmtpathspec) end if fmtpathspec ~= "" then report("using path expansion %a",fmtpathspec) else report("no valid path reported, trying alternative") - fmtpathspec = resultof("kpsewhich --show-path=fmt --engine=%s",texengine) +-- fmtpathspec = resultof("kpsewhich --show-path=fmt --engine=%s",texengine) if fmtpathspec ~= "" then report("using path expansion %a",fmtpathspec) else @@ -91,7 +93,7 @@ function scripts.plain.make(texengine,texformat) end end end - local fmtpath = --expand-path $safe-out-name=$TEXFORMATS +-- local fmtpath = resultof("kpsewhich --expand-path $safe-out-name=$TEXFORMATS") if not fmtpath or fmtpath == "" then fmtpath = "." else |