summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-18 01:56:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-18 01:56:47 +0000
commita9662810df18371af7492dd8298cc0cccc13c7c7 (patch)
tree5a1131ad0ca461f67177e1c7282eacc92356f864 /string.c
parent14aa2e8dda852b6b9277a8a7e16a78654edf1767 (diff)
1.1b8pre1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@76 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/string.c b/string.c
index 972da1bcdb..3c43e2d885 100644
--- a/string.c
+++ b/string.c
@@ -156,12 +156,12 @@ str_dup(str)
}
static VALUE
-str_s_new(class, orig)
- VALUE class;
+str_s_new(klass, orig)
+ VALUE klass;
VALUE orig;
{
NEWOBJ(str, struct RString);
- OBJSETUP(str, class, T_STRING);
+ OBJSETUP(str, klass, T_STRING);
orig = obj_as_string(orig);
str->len = RSTRING(orig)->len;
@@ -897,12 +897,12 @@ str_sub_s(str, pat, val, once)
repl = reg_regsub(val, str, regs);
str_cat(result, RSTRING(repl)->ptr, RSTRING(repl)->len);
- if (END(0) == offset) {
+ if (BEG(0) == END(0)) {
/*
* Always consume at least one character of the input string
* in order to prevent infinite loops.
*/
- if (RSTRING(str)->len > 0) {
+ if (RSTRING(str)->len > END(0)) {
str_cat(result, RSTRING(str)->ptr+END(0), 1);
}
offset = END(0)+1;