summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-04 21:44:20 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-04 21:44:20 +0000
commita2ebc53ec49b0fe42c3fe91dba13e3400a93ade7 (patch)
treee2e61b675c7602493de0059526bdd80fd2ae6262
parenteb8449111929c044e9fe3a4e50a827b2c6271aa3 (diff)
* file.c (realpath_rec): call rb_str_modify before rb_str_set_len.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--file.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c69bb03..45f11b6 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 712d60e..b541a7d 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);
}
}