summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakoto kuwata <kwa@kuwata-lab.com>2011-02-23 13:40:59 +0900
committermakoto kuwata <kwa@kuwata-lab.com>2011-02-23 13:40:59 +0900
commitc945f51552d10e3b7e8e8525fa43c706e43ec4e1 (patch)
tree02fad31912e789ba0753e84c62b5b20d9772ae2c
parentc99e4582731fbe3bfcf95a6905cb30d6a39aa94a (diff)
downloaderubis-c945f51552d10e3b7e8e8525fa43c706e43ec4e1.tar.gz
[bugfix] 'InterporationEnhancer#_add_text_to_str()' raised null-pointer-exception in a certain case
-rw-r--r--lib/erubis/enhancer.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/erubis/enhancer.rb b/lib/erubis/enhancer.rb
index 361a582..2fa2862 100644
--- a/lib/erubis/enhancer.rb
+++ b/lib/erubis/enhancer.rb
@@ -706,8 +706,7 @@ module Erubis
def _add_text_to_str(str, text)
return if !text || text.empty?
- text.gsub!(/[`\#\\]/, '\\\\\&')
- str << text
+ str << text.gsub(/[`\#\\]/, '\\\\\&')
end
def add_expr_escaped(str, code)