summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-08 08:12:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-08 08:12:39 +0000
commit8673eacafa039f056927e0f91ce195afae9b9019 (patch)
treead28cdccaa2ee114d3cf523de4d9f9d0167b2d50 /re.c
parent9c855a83f2c34ecf0e2f448d2213a6b091cdce95 (diff)
local_variables/defined?(TOPLEVEL_CONST) in modules
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/re.c b/re.c
index b34e5e6fc5..262b716c1a 100644
--- a/re.c
+++ b/re.c
@@ -883,7 +883,7 @@ reg_regsub(str, src, regs)
char *ss = s;
c = *s++;
- if (c != '\\') continue;
+ if (c != '\\' || s == e) continue;
if (!val) val = str_new(p, ss-p);
else str_cat(val, p, ss-p);
@@ -913,10 +913,6 @@ reg_regsub(str, src, regs)
if (no == 0) continue;
break;
- case '\\':
- str_cat(val, s-1, 1);
- continue;
-
default:
str_cat(val, s-2, 2);
continue;