ruby-changes:62552
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 11 Aug 2020 16:51:35 +0900 (JST)
Subject: [ruby-changes:62552] b0eb5aa344 (master): RubyVM::CEscape#rstring2cstr: do not escape '
https://git.ruby-lang.org/ruby.git/commit/?id=b0eb5aa344 From b0eb5aa34476636771a6bfa1397115011066c410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Tue, 11 Aug 2020 11:36:48 +0900 Subject: RubyVM::CEscape#rstring2cstr: do not escape ' A single quote "is representable either by itself or by the escape sequence", according to ISO/IEC 9899 (checked all versions). So this is not a bug fix. But the generated output is a bit readable without backslashes. diff --git a/tool/ruby_vm/helpers/c_escape.rb b/tool/ruby_vm/helpers/c_escape.rb index fa3cb8b..a3368b8 100644 --- a/tool/ruby_vm/helpers/c_escape.rb +++ b/tool/ruby_vm/helpers/c_escape.rb @@ -60,7 +60,7 @@ module RubyVM::CEscape https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/helpers/c_escape.rb#L60 "\x18"=>"\\x18", "\x19"=>"\\x19", "\x1A"=>"\\x1a", "\e"=>"\\x1b", "\x1C"=>"\\x1c", "\x1D"=>"\\x1d", "\x1E"=>"\\x1e", "\x1F"=>"\\x1f", " "=> " ", "!"=> "!", "\""=> "\\\"", "#"=> "#", - "$"=> "$", "%"=> "%", "&"=> "&", "'"=> "\\'", + "$"=> "$", "%"=> "%", "&"=> "&", "'"=> "'", "("=> "(", ")"=> ")", "*"=> "*", "+"=> "+", ","=> ",", "-"=> "-", "."=> ".", "/"=> "/", "0"=> "0", "1"=> "1", "2"=> "2", "3"=> "3", -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/