From aef5e141d1336f02563e3ad2b54dfe414d4c8049 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 17 Sep 2012 00:40:23 +0300 Subject: beta 2012.09.16 23:18 --- scripts/context/lua/mtxrun.lua | 13 +++++++++---- scripts/context/stubs/mswin/mtxrun.lua | 13 +++++++++---- scripts/context/stubs/unix/mtxrun | 13 +++++++++---- 3 files changed, 27 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index ca9f2d348..dc8aa2615 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -5936,6 +5936,7 @@ function inspect(i) -- global function else print(tostring(i)) end + return i -- so that we can inline the inspect end -- from the lua book: @@ -8417,10 +8418,14 @@ function xml.load(filename,settings) elseif filename then -- filehandle data = filename:read("*all") end - settings.currentresource = filename - local result = xmlconvert(data,settings) - settings.currentresource = nil - return result + if settings then + settings.currentresource = filename + local result = xmlconvert(data,settings) + settings.currentresource = nil + return result + else + return xmlconvert(data,{ currentresource = filename }) + end end diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index ca9f2d348..dc8aa2615 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -5936,6 +5936,7 @@ function inspect(i) -- global function else print(tostring(i)) end + return i -- so that we can inline the inspect end -- from the lua book: @@ -8417,10 +8418,14 @@ function xml.load(filename,settings) elseif filename then -- filehandle data = filename:read("*all") end - settings.currentresource = filename - local result = xmlconvert(data,settings) - settings.currentresource = nil - return result + if settings then + settings.currentresource = filename + local result = xmlconvert(data,settings) + settings.currentresource = nil + return result + else + return xmlconvert(data,{ currentresource = filename }) + end end diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index ca9f2d348..dc8aa2615 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -5936,6 +5936,7 @@ function inspect(i) -- global function else print(tostring(i)) end + return i -- so that we can inline the inspect end -- from the lua book: @@ -8417,10 +8418,14 @@ function xml.load(filename,settings) elseif filename then -- filehandle data = filename:read("*all") end - settings.currentresource = filename - local result = xmlconvert(data,settings) - settings.currentresource = nil - return result + if settings then + settings.currentresource = filename + local result = xmlconvert(data,settings) + settings.currentresource = nil + return result + else + return xmlconvert(data,{ currentresource = filename }) + end end -- cgit v1.2.3