From a2ebc53ec49b0fe42c3fe91dba13e3400a93ade7 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 4 Aug 2010 21:44:20 +0000 Subject: * 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 --- ChangeLog | 4 ++++ file.c | 1 + 2 files changed, 5 insertions(+) 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 + + * file.c (realpath_rec): call rb_str_modify before rb_str_set_len. + Wed Aug 4 19:37:00 2010 Nobuyoshi Nakada * 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); } } -- cgit v1.2.3