aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--re.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/re.c b/re.c
index c5c533781a..394fc46129 100644
--- a/re.c
+++ b/re.c
@@ -3084,6 +3084,9 @@ reg_operand(VALUE s, int check)
if (SYMBOL_P(s)) {
return rb_sym2str(s);
}
+ else if (RB_TYPE_P(s, T_STRING)) {
+ return s;
+ }
else {
return check ? rb_str_to_str(s) : rb_check_string_type(s);
}