summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 06:19:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 06:19:28 +0000
commit940804adf9b8c3b8004439b7c737368e9aa5f034 (patch)
treef102db8126e81af0ff1a6ceb7dc7372f26c0acee /file.c
parentde2e0412719d51454f50515d191f8ca15a2f60ed (diff)
downloadruby-940804adf9b8c3b8004439b7c737368e9aa5f034.tar.gz
ruby-940804adf9b8c3b8004439b7c737368e9aa5f034.tar.xz
ruby-940804adf9b8c3b8004439b7c737368e9aa5f034.zip
* file.c (file_expand_path): constified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/file.c b/file.c
index 2cabda7d3..b42bc2eee 100644
--- a/file.c
+++ b/file.c
@@ -2560,7 +2560,8 @@ static int is_absolute_path(const char*);
static VALUE
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;
int tainted;
rb_encoding *extenc = 0;
@@ -2706,12 +2707,13 @@ file_expand_path(VALUE fname, VALUE dname, VALUE result)
case '.':
if (*(s+1) == '\0' || isdirsep(*(s+1))) {
/* We must go back to the parent */
+ char *n;
*p = '\0';
- if (!(b = strrdirsep(root))) {
+ if (!(n = strrdirsep(root))) {
*p = '/';
}
else {
- p = b;
+ p = n;
}
b = ++s;
}