1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Escape '/*' within block comment too

This commit is contained in:
Nobuyoshi Nakada 2020-10-26 09:01:27 +09:00
parent b6d0b3dfaf
commit 396e921044
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -17,7 +17,7 @@ module RubyVM::CEscape
# generate comment, with escaps.
def commentify str
return "/* #{str.b.gsub '*/', '*\\/'} */"
return "/* #{str.b.gsub('*/', '*\\/').gsub('/*', '/\\*')} */"
end
# Mimic gensym of CL.