summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/file.c b/file.c
index 5265d3a3a5..92338bb754 100644
--- a/file.c
+++ b/file.c
@@ -4090,6 +4090,9 @@ static VALUE
str_shrink(VALUE str)
{
rb_str_resize(str, RSTRING_LEN(str));
+ // expand_path on Windows can sometimes mutate the string
+ // without clearing its coderange
+ ENC_CODERANGE_CLEAR(str);
return str;
}