summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-29 06:14:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-29 06:14:10 +0000
commit89dbf99bacac40fa17045c8322f20fc4c9c8d070 (patch)
treec7c2046d45ef6226d94a7ef28e91942efed2408f /re.c
parent448610abec3558780d541606261a090d279e26be (diff)
* numeric.c (num_to_int): default to_int implementaion for every
numeric class. * re.c (rb_reg_quote): initial part of the string was never copied to the quoted string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/re.c b/re.c
index 90999a9572..5663f02919 100644
--- a/re.c
+++ b/re.c
@@ -1205,6 +1205,9 @@ rb_reg_quote(str)
meta_found:
tmp = rb_str_new(0, RSTRING(str)->len*2);
t = RSTRING(tmp)->ptr;
+ /* copy upto metacharacter */
+ memcpy(t, RSTRING(str)->ptr, s - RSTRING(str)->ptr);
+ t += s - RSTRING(str)->ptr;
for (; s < send; s++) {
c = *s;