From 5e433ffc6c368146a7d646c45e69b8f6978b9d38 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 20 Apr 2008 06:19:28 +0000 Subject: [PATCH] * file.c (file_expand_path): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file.c b/file.c index 2cabda7d3e..b42bc2eeec 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; }