summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-06 08:25:12 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-06 08:25:12 +0000
commite2b92403d5fdb91ed3c7eb26a693c82a4cf4b046 (patch)
tree4500e3bcab21330db6d18bb65f41c32a118a446e /string.c
parentda19d16b1c5efa1b2d9076e245ababc5ec9ad2dd (diff)
* re.c (rb_reg_initialize_m): 3rd argument was ignored.
* string.c (rb_str_count): return 0 for empty string (was returning nil). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index d2fdc44806..0cadd61fe2 100644
--- a/string.c
+++ b/string.c
@@ -2478,7 +2478,7 @@ rb_str_count(argc, argv, str)
}
s = RSTRING(str)->ptr;
- if (!s || RSTRING(str)->len == 0) return Qnil;
+ if (!s || RSTRING(str)->len == 0) return INT2FIX(0);
send = s + RSTRING(str)->len;
i = 0;
while (s < send) {