From 343a75366482319f53b4bacaf971af974d4298ed Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 13 Jul 2014 11:30:23 +0000 Subject: [PATCH] WoWAPI: Add strsplit to string module and fix for "." in delimiter string. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1533 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- WoWAPI.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WoWAPI.lua b/WoWAPI.lua index 64498ed..ff84af1 100644 --- a/WoWAPI.lua +++ b/WoWAPI.lua @@ -379,6 +379,8 @@ end http://lua-users.org/wiki/SplitJoin --]]-------------------------------------------------------------------- WoWAPI.strsplit = function(delim, str, maxNb) + -- Fix up '.' character class. + delim = string.gsub(delim, "%.", "%%.") -- Eliminate bad cases... if string.find(str, delim) == nil then return str @@ -513,6 +515,8 @@ function WoWAPI:ExportSymbols(namespace) namespace[k] = namespace[k] or v end end + -- Special handling for strsplit() to add to "string" module. + string.split = string.split or WoWAPI.strsplit -- Special handling for wipe() to add to "table" module. table.wipe = table.wipe or WoWAPI.wipe end -- 1.7.9.5