summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 09:59:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-06 09:59:31 +0000
commit8aa6059dbfcf840b9e7870ca9639194e707b05a0 (patch)
tree9e93d17818f76bc9ae03d93429c6ae1d5532817c
parentb4ba3ba6410d33e4ac15cce8b633f8d1f525f107 (diff)
* file.c (realpath_rec): rb_str_modify depends on the length, so
resize instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index dfc4039995..5b03e712b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 6 18:59:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (realpath_rec): rb_str_modify depends on the length, so
+ resize instead.
+
Fri Aug 6 18:56:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in (clean-ext): fixed directories to be removed.
diff --git a/file.c b/file.c
index b541a7dba0..962fa9ac4e 100644
--- a/file.c
+++ b/file.c
@@ -3229,8 +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);
+ rb_str_resize(*resolvedp, *prefixlenp + len);
}
}
else {