* file.c (file_expand_path): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d92efa3c0b
commit
5e433ffc6c
8
file.c
8
file.c
@ -2560,7 +2560,8 @@ static int is_absolute_path(const char*);
|
|||||||
static VALUE
|
static VALUE
|
||||||
file_expand_path(VALUE fname, VALUE dname, VALUE result)
|
file_expand_path(VALUE fname, VALUE dname, VALUE result)
|
||||||
{
|
{
|
||||||
char *s, *buf, *b, *p, *pend, *root;
|
const char *s, *b;
|
||||||
|
char *buf, *p, *pend, *root;
|
||||||
long buflen, dirlen;
|
long buflen, dirlen;
|
||||||
int tainted;
|
int tainted;
|
||||||
rb_encoding *extenc = 0;
|
rb_encoding *extenc = 0;
|
||||||
@ -2706,12 +2707,13 @@ file_expand_path(VALUE fname, VALUE dname, VALUE result)
|
|||||||
case '.':
|
case '.':
|
||||||
if (*(s+1) == '\0' || isdirsep(*(s+1))) {
|
if (*(s+1) == '\0' || isdirsep(*(s+1))) {
|
||||||
/* We must go back to the parent */
|
/* We must go back to the parent */
|
||||||
|
char *n;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if (!(b = strrdirsep(root))) {
|
if (!(n = strrdirsep(root))) {
|
||||||
*p = '/';
|
*p = '/';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p = b;
|
p = n;
|
||||||
}
|
}
|
||||||
b = ++s;
|
b = ++s;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user