aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
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 3bb6780e4b..1de91ff525 100644
--- a/string.c
+++ b/string.c
@@ -4243,7 +4243,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
enc = rb_enc_check(src, repl);
}
trsrc.p = RSTRING_PTR(src); trsrc.pend = trsrc.p + RSTRING_LEN(src);
- if (RSTRING_LEN(str) > 1 &&
+ if (RSTRING_LEN(src) > 1 &&
rb_enc_ascget(trsrc.p, trsrc.pend, &l, enc) == '^' &&
trsrc.p + l < trsrc.pend) {
cflag = 1;