ruby-changes:62599
From: Nobuyoshi <ko1@a...>
Date: Mon, 17 Aug 2020 22:37:37 +0900 (JST)
Subject: [ruby-changes:62599] 27f7b047e0 (master): Also escape DEL code
https://git.ruby-lang.org/ruby.git/commit/?id=27f7b047e0 From 27f7b047e07ceb9ee963e5d74ab0399b5e94ac4c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 17 Aug 2020 22:36:48 +0900 Subject: Also escape DEL code diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index 81e490f..d5996f6 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -85,6 +85,9 @@ dump_append_string_value(struct dump_config *dc, VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L85 case '\r': dump_append(dc, "\\r"); break; + case '\177': + dump_append(dc, "\\u007f"); + break; default: if (c <= 0x1f) dump_append(dc, "\\u%04x", c); diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 9d05a4c..5073bbe 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -277,6 +277,7 @@ class TestObjSpace < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L277 def test_dump_control_char assert_include(ObjectSpace.dump("\x0f"), '"value":"\u000f"') + assert_include(ObjectSpace.dump("\C-?"), '"value":"\u007f"') end def test_dump_special_consts -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/