From 40247309592de8592e5c023fd74a4d207caa202f Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 22 Jun 2006 02:49:28 +0000 Subject: [PATCH] * variable.c (rb_mod_name): returns nil for anonymous modules. [ruby-talk:198440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ variable.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a62b4fe4b7..8991e0833a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 22 11:47:52 2006 Yukihiro Matsumoto + + * variable.c (rb_mod_name): returns nil for anonymous modules. + [ruby-talk:198440] + Thu Jun 22 10:31:39 2006 Yukihiro Matsumoto * string.c (rb_str_aref): "abc"[3] should not return an empty diff --git a/variable.c b/variable.c index 50f3e092fe..95f4743e33 100644 --- a/variable.c +++ b/variable.c @@ -163,7 +163,7 @@ classname(VALUE klass) * call-seq: * mod.name => string * - * Returns the name of the module mod. + * Returns the name of the module mod. Returns nil for anonymous modules. */ VALUE @@ -172,7 +172,7 @@ rb_mod_name(VALUE mod) VALUE path = classname(mod); if (!NIL_P(path)) return rb_str_dup(path); - return rb_str_new(0,0); + return path; } VALUE