aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lanes.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lanes.lua b/src/lanes.lua
index 92a8703..90f9cd2 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -53,6 +53,7 @@ local assert = assert(assert)
53local error = assert(error) 53local error = assert(error)
54local pairs = assert(pairs) 54local pairs = assert(pairs)
55local string = assert(string, "'string' library not available") 55local string = assert(string, "'string' library not available")
56local string_find = assert(string.find)
56local string_gmatch = assert(string.gmatch) 57local string_gmatch = assert(string.gmatch)
57local string_format = assert(string.format) 58local string_format = assert(string.format)
58local select = assert(select) 59local select = assert(select)
@@ -370,6 +371,9 @@ local gen = function(...)
370 -- check that the caller only provides reserved library names, and those only once 371 -- check that the caller only provides reserved library names, and those only once
371 -- "*" is a special case that doesn't require individual checking 372 -- "*" is a special case that doesn't require individual checking
372 if libs and libs ~= "*" then 373 if libs and libs ~= "*" then
374 if string_find(libs, "*", 2, true) then
375 error "Libs specification '*' must be used alone"
376 end
373 local found = {} 377 local found = {}
374 for s in string_gmatch(libs, "[%a%d.]+") do 378 for s in string_gmatch(libs, "[%a%d.]+") do
375 if not valid_libs[s] then 379 if not valid_libs[s] then
@@ -377,7 +381,7 @@ local gen = function(...)
377 else 381 else
378 found[s] = (found[s] or 0) + 1 382 found[s] = (found[s] or 0) + 1
379 if found[s] > 1 then 383 if found[s] > 1 then
380 error("libs specification contains '" .. s .. "' more than once", 2) 384 error("Libs specification contains '" .. s .. "' more than once", 2)
381 end 385 end
382 end 386 end
383 end 387 end