aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-dbi/fix-table-maxn.patch
blob: a5036ab496b1dc05392be329eebe67a15823e0bb (plain)
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
From 23bac7124f27c7e36431932e77c68fca91c96c25 Mon Sep 17 00:00:00 2001
From: sparked435 <aaron@zadzmo.org>
Date: Thu, 24 Aug 2017 15:05:49 -0400
Subject: [PATCH] Fix minor post-5.1 bug: table.maxn() has been removed. Should
 only trigger if no drivers are available, an error condition anyway.

Patch-Source: https://github.com/mwild1/luadbi/commit/23bac7124f27c7e36431932e77c68fca91c96c25
---
 DBI.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/DBI.lua b/DBI.lua
index 4dc77d2..e1f504a 100644
--- a/DBI.lua
+++ b/DBI.lua
@@ -28,8 +28,8 @@ local function available_drivers()
     end
 
     -- no drivers available
-    if table.maxn(available) < 1 then
-	available = {'(None)'}
+    if #available < 1 then
+		available = {'(None)'}
     end
 
     return available