Skip to content

Commit

Permalink
escape % in replacer
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulBernier committed Oct 24, 2014
1 parent 3b52405 commit 94a61bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/castl/prototype/string.lua
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ return function(stringPrototype)
end
else
replacer = ToString(newSubStr)
-- escape %
replacer = gsub(replacer, "%%", "%%%%")

-- handle $ parameters
replacer = gsub(replacer, "%$&", "$0")
Expand Down

0 comments on commit 94a61bb

Please sign in to comment.