summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 10:09:53 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 10:09:53 +0000
commit5101be8a5142d4f7acd0b4882deb4327f6da542b (patch)
tree3c1d2268c042c0dc2bbd870e22c75afabaed9631
parent658788f7b725cf6ff05f40c23302ab73c63e0de3 (diff)
* file.c (rb_file_chown): should accept nil. [ruby-dev:27171] (backport from trunk, rev 1.208)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 35aacbf..33addaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Sep 19 19:09:08 2005 Minero Aoki <aamine@loveruby.net>
+
+ * file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
+ (backport from trunk, rev 1.208)
+
Mon Sep 19 18:35:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/dl/dl.c (rb_io_to_ptr): fix DragonFlyBSD support.
diff --git a/file.c b/file.c
index 0f35ec0..c6e7b34 100644
--- a/file.c
+++ b/file.c
@@ -1747,8 +1747,8 @@ rb_file_chown(obj, owner, group)
int o, g;
rb_secure(2);
- o = NUM2INT(owner);
- g = NUM2INT(group);
+ o = NIL_P(owner) ? -1 : NUM2INT(owner);
+ g = NIL_P(group) ? -1 : NUM2INT(group);
GetOpenFile(obj, fptr);
#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__)
if (!fptr->path) return Qnil;