From cf4451e8c27936dcd71b5eac7105ff52e02f1e95 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 8 Nov 2001 09:21:59 +0000 Subject: * 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 --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 24d3de2ab8..bcce2008a5 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; } -- cgit v1.2.3