Commit e3fed8aaf4b2b9c3a7a0b719acd52408b1d4f90a

Authored by Valeriy Sizov
1 parent 00bc0e25

InlineDiff: fix bug "unmatched close parenthesis"

Showing 1 changed file with 2 additions and 3 deletions   Show diff stats
lib/gitlab/inline_diff.rb
@@ -34,9 +34,8 @@ module Gitlab @@ -34,9 +34,8 @@ module Gitlab
34 end 34 end
35 last_the_same_symbols += 1 35 last_the_same_symbols += 1
36 last_token = first_line[last_the_same_symbols..-1] 36 last_token = first_line[last_the_same_symbols..-1]
37 -  
38 - diff_arr[index+1].sub!(/#{last_token}$/, FINISH + last_token)  
39 - diff_arr[index+2].sub!(/#{last_token}$/, FINISH + last_token) 37 + diff_arr[index+1].sub!(/#{Regexp.escape(last_token)}$/, FINISH + last_token)
  38 + diff_arr[index+2].sub!(/#{Regexp.escape(last_token)}$/, FINISH + last_token)
40 end 39 end
41 diff_arr 40 diff_arr
42 end 41 end