summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--file.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c69bb03994..45f11b6413 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Aug 5 06:42:31 2010 Tanaka Akira <akr@fsij.org>
+
+ * file.c (realpath_rec): call rb_str_modify before rb_str_set_len.
+
Wed Aug 4 19:37:00 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_set_len): rb_str_modify cannot work before the
diff --git a/file.c b/file.c
index 712d60ef45..b541a7dba0 100644
--- a/file.c
+++ b/file.c
@@ -3229,6 +3229,7 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
char *resolved_names = RSTRING_PTR(*resolvedp) + *prefixlenp;
char *lastsep = rb_path_last_separator(resolved_names);
long len = lastsep ? lastsep - resolved_names : 0;
+ rb_str_modify(*resolvedp);
rb_str_set_len(*resolvedp, *prefixlenp + len);
}
}