From 56893e9dcd1eeebffb42b227a2151e18d49bc370 Mon Sep 17 00:00:00 2001 From: Gerardo Marset Date: Mon, 25 Feb 2013 20:28:28 -0200 Subject: Use the length operator (#) instead of table.getn. table.getn was deprecated in Lua 5.1 in favor of #, the length operator. See: http://www.lua.org/manual/5.1/manual.html#7.2 --- samples/lpr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samples/lpr.lua') diff --git a/samples/lpr.lua b/samples/lpr.lua index 2b059b1..3d5e2f8 100644 --- a/samples/lpr.lua +++ b/samples/lpr.lua @@ -29,7 +29,7 @@ end do local opt = {} local pat = "[%s%c%p]*([%w]*)=([\"]?[%w%s_!@#$%%^&*()<>:;]+[\"]\?\.?)" - for i = 2, table.getn(arg), 1 do + for i = 2, #arg, 1 do string.gsub(arg[i], pat, function(name, value) opt[name] = value end) end if not arg[2] then -- cgit v1.2.3-55-g6feb