[前][次][番号順一覧][スレッド一覧]

ruby-changes:36008

From: duerst <ko1@a...>
Date: Wed, 22 Oct 2014 19:18:35 +0900 (JST)
Subject: [ruby-changes:36008] duerst:r48089 (trunk): tool/unicode_norm_gen.rb: Fixed escaping of backslash and

duerst	2014-10-22 19:18:20 +0900 (Wed, 22 Oct 2014)

  New Revision: 48089

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48089

  Log:
    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).

  Modified files:
    trunk/ChangeLog
    trunk/tool/unicode_norm_gen.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48088)
+++ ChangeLog	(revision 48089)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Oct 22 19:18:18 2014  Martin Duerst <duerst@i...>
+
+	* 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@r...>
 
 	* test/test-unicode_normalize.rb: as often said, ruby is sometimes built
Index: tool/unicode_norm_gen.rb
===================================================================
--- tool/unicode_norm_gen.rb	(revision 48088)
+++ tool/unicode_norm_gen.rb	(revision 48089)
@@ -17,7 +17,7 @@ class Integer https://github.com/ruby/ruby/blob/trunk/tool/unicode_norm_gen.rb#L17
     elsif self>0x7f
       "\\u#{to_s(16).upcase.rjust(4, '0')}"
     else
-      chr.sub(/[\\\"]/, '\\\&')
+      chr.sub(/[\\\"]/, "\\\\\\\&")
     end
   end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]