From 7e766f9aaadaf46e36a35c13cd59f8a30b11b610 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius Date: Sun, 2 Jun 2013 17:25:20 +0200 Subject: [PATCH] Fix markdown.lua to work with LUA 5.2 The `setfenv` variable is unavailable in LUA 5.2, so call it conditionally. --- ldoc/markdown.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldoc/markdown.lua b/ldoc/markdown.lua index bfe3a1b..a89b38e 100644 --- a/ldoc/markdown.lua +++ b/ldoc/markdown.lua @@ -121,7 +121,7 @@ THE SOFTWARE. local M = {} local MT = {__index = _G} setmetatable(M, MT) -setfenv(1, M) +if setfenv then setfenv(1, M) end -- if true, we are using LUA 5.1 ---------------------------------------------------------------------- -- Utility functions @@ -1134,7 +1134,7 @@ end -- End of module ---------------------------------------------------------------------- -setfenv(1, _G) +if setfenv then setfenv(1, _G) end M.lock(M) -- Expose markdown function to the world