aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/file.c b/file.c
index a7b4fe010e..5d51005260 100644
--- a/file.c
+++ b/file.c
@@ -2877,7 +2877,8 @@ rb_file_join(VALUE ary, VALUE sep)
len += 10;
}
}
- if (!NIL_P(sep) && TYPE(sep) == T_STRING) {
+ if (!NIL_P(sep)) {
+ StringValue(sep);
len += RSTRING(sep)->len * RARRAY(ary)->len - 1;
}
result = rb_str_buf_new(len);