diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-18 01:56:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-02-18 01:56:47 +0000 |
commit | a9662810df18371af7492dd8298cc0cccc13c7c7 (patch) | |
tree | 5a1131ad0ca461f67177e1c7282eacc92356f864 /string.c | |
parent | 14aa2e8dda852b6b9277a8a7e16a78654edf1767 (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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |