summaryrefslogtreecommitdiff
path: root/lualibs-io.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualibs-io.lua')
-rw-r--r--lualibs-io.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/lualibs-io.lua b/lualibs-io.lua
index 5a126da..66e2793 100644
--- a/lualibs-io.lua
+++ b/lualibs-io.lua
@@ -170,13 +170,14 @@ function io.ask(question,default,options)
elseif not options then
return answer
else
- for _,v in pairs(options) do
- if v == answer then
+ for k=1,#options do
+ if options[k] == answer then
return answer
end
end
local pattern = "^" .. answer
- for _,v in pairs(options) do
+ for k=1,#options do
+ local v = options[k]
if find(v,pattern) then
return v
end