aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r--lualib/lua_util.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index 308663399..7cabeed2d 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -113,7 +113,7 @@ end
-- @return {boolean} true if text ends with the specified suffix, false otherwise
--]]
exports.str_endswith = function(s, suffix)
- return s:sub(-suffix:len()) == suffix
+ return s:find(suffix, -suffix:len(), true) ~= nil
end
--[[[