Skip to content

Commit

Permalink
fix strange string.match incorrect behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
zwirec committed Jun 13, 2019
1 parent b5cb10e commit f4e2b31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/luarocks/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ function util.opts_table(type_name, valid_opts)
if not valid_opts[k] then
error("invalid option: "..k)
end
local vo, optional = valid_opts[k]:match("^(.-)(%??)$")
local vo, optional = valid_opts[k]:match("^(.-)(%?-)$")
if not (tv == vo or (optional == "?" and tv == nil)) then
error("invalid type option: "..k.." - got "..tv..", expected "..vo)
end
Expand Down

0 comments on commit f4e2b31

Please sign in to comment.