webmcp

diff libraries/rocketcgi/rocketcgi.lua @ 64:3d43a5cf17c1

Compatibility with Lua 5.2
author jbe
date Sun Apr 15 16:04:33 2012 +0200 (2012-04-15)
parents 486ad118c277
children 6c4a5b136074
line diff
     1.1 --- a/libraries/rocketcgi/rocketcgi.lua	Tue Apr 03 00:56:02 2012 +0200
     1.2 +++ b/libraries/rocketcgi/rocketcgi.lua	Sun Apr 15 16:04:33 2012 +0200
     1.3 @@ -3,24 +3,20 @@
     1.4  local assert         = assert
     1.5  local collectgarbage = collectgarbage
     1.6  local error          = error
     1.7 -local getfenv        = getfenv
     1.8  local getmetatable   = getmetatable
     1.9  local ipairs         = ipairs
    1.10  local next           = next
    1.11  local pairs          = pairs
    1.12 -local pcall          = pcall
    1.13  local print          = print
    1.14  local rawequal       = rawequal
    1.15  local rawget         = rawget
    1.16 +local rawlen         = rawlen
    1.17  local rawset         = rawset
    1.18  local select         = select
    1.19 -local setfenv        = setfenv
    1.20  local setmetatable   = setmetatable
    1.21  local tonumber       = tonumber
    1.22  local tostring       = tostring
    1.23  local type           = type
    1.24 -local unpack         = unpack
    1.25 -local xpcall         = xpcall
    1.26  
    1.27  local io     = io
    1.28  local math   = math
    1.29 @@ -28,7 +24,13 @@
    1.30  local string = string
    1.31  local table  = table
    1.32  
    1.33 -module(...)
    1.34 +local _M = {}
    1.35 +if _ENV then
    1.36 +  _ENV = _M
    1.37 +else
    1.38 +  _G[...] = _M
    1.39 +  setfenv(1, _M)
    1.40 +end
    1.41  
    1.42  data_sent = false
    1.43  
    1.44 @@ -307,3 +309,5 @@
    1.45  else
    1.46    post_data = nil
    1.47  end
    1.48 +
    1.49 +return _M

Impressum / About Us