From 0c272722ac643551ac2bf39f47ff37efafc9ac38 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 15 Jan 2001 07:01:00 +0000 Subject: Mon Jan 15 16:00:07 2001 Yukihiro Matsumoto * pack.c (pack_unpack): should check associated pointer packed by pack("P"). restriction added. Sun Jan 14 21:49:28 2001 Koji Arai * sprintf.c (rb_f_sprintf): simple typo. binary base should be 2, not '2'. * re.c (rb_reg_s_last_match): should explicitly return nth match. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 9137b0fc5..b5f44b9d8 100644 --- a/string.c +++ b/string.c @@ -174,6 +174,16 @@ rb_str_associate(str, add) rb_ary_push(RSTRING(str)->orig, add); } +VALUE +rb_str_associated(str) + VALUE str; +{ + if (!FL_TEST(str, STR_NO_ORIG)) { + return Qfalse; + } + return RSTRING(str)->orig; +} + static ID to_str; VALUE -- cgit