tool/unicode_norm_gen.rb: Fixed escaping of backslash and

double quote ('\\\&' -> "\\\\\\\&"; double quoted string
is needed to make \& mean last match; double double
backslashes are needed because of two layers of escaping).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2014-10-22 10:18:20 +00:00
Родитель 2767d9a8cf
Коммит 71c534c962
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,10 @@
Wed Oct 22 19:18:18 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
* tool/unicode_norm_gen.rb: Fixed escaping of backslash and
double quote ('\\\&' -> "\\\\\\\&"; double quoted string
is needed to make \& mean last match; double double
backslashes are needed because of two layers of escaping).
Wed Oct 22 18:13:29 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* test/test-unicode_normalize.rb: as often said, ruby is sometimes built

Просмотреть файл

@ -17,7 +17,7 @@ class Integer
elsif self>0x7f
"\\u#{to_s(16).upcase.rjust(4, '0')}"
else
chr.sub(/[\\\"]/, '\\\&')
chr.sub(/[\\\"]/, "\\\\\\\&")
end
end
end