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

ruby-changes:63438

From: Nobuyoshi <ko1@a...>
Date: Mon, 26 Oct 2020 12:40:12 +0900 (JST)
Subject: [ruby-changes:63438] 396e921044 (master): Escape '/*' within block comment too

https://git.ruby-lang.org/ruby.git/commit/?id=396e921044

From 396e92104474921ee58ff75ff63d3db0d503dacc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 26 Oct 2020 09:01:27 +0900
Subject: Escape '/*' within block comment too


diff --git a/tool/ruby_vm/helpers/c_escape.rb b/tool/ruby_vm/helpers/c_escape.rb
index e9a8da6..34fafd1 100644
--- a/tool/ruby_vm/helpers/c_escape.rb
+++ b/tool/ruby_vm/helpers/c_escape.rb
@@ -17,7 +17,7 @@ module RubyVM::CEscape https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/helpers/c_escape.rb#L17
 
   # generate comment, with escaps.
   def commentify str
-    return "/* #{str.b.gsub '*/', '*\\/'} */"
+    return "/* #{str.b.gsub('*/', '*\\/').gsub('/*', '/\\*')} */"
   end
 
   # Mimic gensym of CL.
-- 
cgit v0.10.2


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

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