From 794fc684e8441afb840137e16fb26eafe3245c05 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 4 Nov 2007 14:53:36 +0000 Subject: [PATCH] * re.c (rb_reg_initialize_m): use StringValuePtr instead of StringValueCStr because \0 exists when Regexp.new("\0"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ re.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9f18ab4fa4..6cf5e684bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 4 23:51:59 2007 Tanaka Akira + + * re.c (rb_reg_initialize_m): use StringValuePtr instead of + StringValueCStr because \0 exists when Regexp.new("\0"). + Sun Nov 4 08:11:19 2007 Tanaka Akira * gc.c (count_objects): count TOTAL. diff --git a/re.c b/re.c index 8acf438cb2..a6b9828a69 100644 --- a/re.c +++ b/re.c @@ -1617,7 +1617,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self) } } str = argv[0]; - ptr = StringValueCStr(str); + ptr = StringValuePtr(str); if (enc ? rb_reg_initialize(self, ptr, RSTRING_LEN(str), enc, flags, err) : rb_reg_initialize_str(self, str, flags, err)) {