mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
eb84491119
commit
a2ebc53ec4
2 changed files with 5 additions and 0 deletions
|
@ -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>
|
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
|
* string.c (rb_str_set_len): rb_str_modify cannot work before the
|
||||||
|
|
1
file.c
1
file.c
|
@ -3229,6 +3229,7 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
|
||||||
char *resolved_names = RSTRING_PTR(*resolvedp) + *prefixlenp;
|
char *resolved_names = RSTRING_PTR(*resolvedp) + *prefixlenp;
|
||||||
char *lastsep = rb_path_last_separator(resolved_names);
|
char *lastsep = rb_path_last_separator(resolved_names);
|
||||||
long len = lastsep ? lastsep - resolved_names : 0;
|
long len = lastsep ? lastsep - resolved_names : 0;
|
||||||
|
rb_str_modify(*resolvedp);
|
||||||
rb_str_set_len(*resolvedp, *prefixlenp + len);
|
rb_str_set_len(*resolvedp, *prefixlenp + len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue