unified_diff.rb.diff

Correct UTF-8 parsing - Filou Centrinov, 2013-03-05 00:16

Download (787 Bytes)

View differences:

lib/redmine/unified_diff.rb (working copy)
207 207
        while starting < max && line_left[starting] == line_right[starting]
208 208
          starting += 1
209 209
        end
210
        while line_left[starting].ord.between?(128, 191) && starting > 0
211
          starting -= 1
212
        end
210 213
        ending = -1
211 214
        while ending >= -(max - starting) && line_left[ending] == line_right[ending]
212 215
          ending -= 1
213 216
        end
217
        while line_left[ending].ord.between?(128, 191) && ending > -1
218
          ending -= 1
219
        end
214 220
        unless starting == 0 && ending == -1
215 221
          [starting, ending]
216 222
        end