summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 44a791e9dc..7b46291158 100644
--- a/file.c
+++ b/file.c
@@ -2740,8 +2740,9 @@ file_expand_path(fname, dname, result)
if (p == skiproot(buf) - 1) p++;
buflen = p - buf;
-#if USE_NTFS
+ RSTRING(result)->len = buflen;
*p = '\0';
+#if USE_NTFS
if (!strpbrk(b = buf, "*?")) {
size_t len;
WIN32_FIND_DATA wfd;
@@ -2792,7 +2793,6 @@ file_expand_path(fname, dname, result)
#endif
if (tainted) OBJ_TAINT(result);
- rb_str_set_len(result, buflen);
return result;
}