summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-08 09:21:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-08 09:21:59 +0000
commitcf4451e8c27936dcd71b5eac7105ff52e02f1e95 (patch)
tree14d1818ca2fd8543ef14ccdcb47c55827bdf9815 /file.c
parentdc98adf839d0d68c4c18647a1db2fb3dc9be8cc4 (diff)
* file.c (path_check_1): forgot to initialize 'p'.
* mkconfig.rb: use String#dump to generate Ruby string literal. * range.c (range_eql): should override 'eql?' * array.c (rb_ary_hash): should override 'hash' too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 24d3de2..bcce200 100644
--- a/file.c
+++ b/file.c
@@ -2237,7 +2237,7 @@ path_check_1(path)
{
struct stat st;
char *p0 = RSTRING(path)->ptr;
- char *p, *s;
+ char *p = 0, *s;
if (!is_absolute_path(p0)) {
char *buf = my_getcwd();
@@ -2281,8 +2281,8 @@ rb_path_check(path)
if (!path_check_1(rb_str_new(p0, p - p0))) {
return 0; /* not safe */
}
- if (p0 > pend) break;
p0 = p + 1;
+ if (p0 > pend) break;
p = strchr(p0, sep);
if (!p) p = pend;
}