hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 2d824d2fce31b6a9cc60b2c3f215fbbf1d99c611 Mon Sep 17 00:00:00 2001
From: mpeterv <mpeterval@gmail.com>
Date: Thu, 3 Dec 2015 13:10:14 +0300
Subject: [PATCH] Lua 5.3 compatibility
 
Fetched from: https://github.com/keplerproject/wsapi/commit/2d824d2fce31b6a9cc60b2c3f215fbbf1d99c611
 
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 src/wsapi/ringer.lua | 1 +
 src/wsapi/util.lua   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 
diff --git a/wsapi-1.6.1/src/wsapi/ringer.lua b/wsapi-1.6.1/src/wsapi/ringer.lua
index 58309f2..db7b68f 100644
--- a/wsapi-1.6.1/src/wsapi/ringer.lua
+++ b/wsapi-1.6.1/src/wsapi/ringer.lua
@@ -5,6 +5,7 @@ local rings = require "rings"
 local _M = {}
 
 local init = [==[
+  local loadstring = loadstring or load
   local app_name, bootstrap_code, is_file = ...
   if bootstrap_code then
     local bootstrap, err
diff --git a/wsapi-1.6.1/src/wsapi/util.lua b/wsapi-1.6.1/src/wsapi/util.lua
index 24d3cfe..34e5816 100644
--- a/wsapi-1.6.1/src/wsapi/util.lua
+++ b/wsapi-1.6.1/src/wsapi/util.lua
@@ -174,7 +174,7 @@ function _M.make_env_post(pd, type, qs)
 end
 
 function _M.loadfile(filename, env)
-  if _VERSION == "Lua 5.2" then
+  if _VERSION ~= "Lua 5.1" then
     return loadfile(filename, "bt", env)
   else
     local f, err = loadfile(filename)
-- 
2.14.1