Merge pull request #18 from mpeterv/remove-redundant-function

Remove redundant `escapeChar` function
This commit is contained in:
Enrique García 2014-11-19 17:57:37 +01:00
commit 47e186d1e2

View File

@ -45,10 +45,8 @@ local controlCharsTranslation = {
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v"
}
local function escapeChar(c) return controlCharsTranslation[c] end
local function escape(str)
local result = str:gsub("\\", "\\\\"):gsub("(%c)", escapeChar)
local result = str:gsub("\\", "\\\\"):gsub("(%c)", controlCharsTranslation)
return result
end