summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index f297983cc2..324ff956e7 100644
--- a/encoding.c
+++ b/encoding.c
@@ -399,7 +399,7 @@ rb_enc_compatible(VALUE str1, VALUE str2)
}
if (cr2 == ENC_CODERANGE_7BIT) {
if (idx1 == 0) return rb_enc_from_index(idx2);
- if (idx2 == 0) return rb_enc_from_index(idx1);
+ return rb_enc_from_index(idx1);
}
}
if (cr1 == ENC_CODERANGE_7BIT &&