summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 2 insertions, 2 deletions
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 <i>mod</i>.
+ * Returns the name of the module <i>mod</i>. 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