From 6767cd760a8f5274e238fca4567071a78ac43968 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Sep 2001 06:54:11 +0000 Subject: * string.c (rb_str_init): String.new() => "" * dir.c (dir_path): new method. * dir.c (dir_initialize): wrap DIR into struct, along with path information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index dbc9ac1c2a..68b658991e 100644 --- a/file.c +++ b/file.c @@ -76,7 +76,7 @@ static VALUE rb_cStat; static int apply2files(func, vargs, arg) - int (*func)(); + void (*func)(); VALUE vargs; void *arg; { @@ -87,8 +87,7 @@ apply2files(func, vargs, arg) for (i=0; ilen; i++) { path = args->ptr[i]; SafeStringValue(path); - if ((*func)(RSTRING(path)->ptr, arg) < 0) - rb_sys_fail(RSTRING(path)->ptr); + (*func)(RSTRING(path)->ptr, arg); } return args->len; @@ -913,7 +912,7 @@ chmod_internal(path, mode) const char *path; int mode; { - if (chmod(path, mode) == -1) + if (chmod(path, mode) < 0) rb_sys_fail(path); } @@ -963,7 +962,7 @@ lchmod_internal(path, mode) const char *path; int mode; { - if (lchmod(path, mode) == -1) + if (lchmod(path, mode) < 0) rb_sys_fail(path); } -- cgit v1.2.3