ruby-changes:4605
From: ko1@a...
Date: Sun, 20 Apr 2008 15:19:38 +0900 (JST)
Subject: [ruby-changes:4605] nobu - Ruby:r16099 (trunk): * file.c (file_expand_path): constified.
nobu 2008-04-20 15:19:28 +0900 (Sun, 20 Apr 2008)
New Revision: 16099
Modified files:
trunk/file.c
Log:
* file.c (file_expand_path): constified.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/file.c?r1=16099&r2=16098&diff_format=u
Index: file.c
===================================================================
--- file.c (revision 16098)
+++ file.c (revision 16099)
@@ -2560,7 +2560,8 @@
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 @@
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;
}
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/