summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 09:58:52 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 09:58:52 +0000
commit13e32804c892bc8f4171f4c9cd73b7fed7645dc3 (patch)
treea4ba532335ddb0df64835e3517757b85d26ac121 /file.c
parent05bbe47ffe39f64e3cd4dfa3f55f081bc3a627fd (diff)
downloadruby-13e32804c892bc8f4171f4c9cd73b7fed7645dc3.tar.gz
ruby-13e32804c892bc8f4171f4c9cd73b7fed7645dc3.tar.xz
ruby-13e32804c892bc8f4171f4c9cd73b7fed7645dc3.zip
* file.c (rb_file_chown): should accept nil. [ruby-dev:27171]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9232 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 740ec77bd..6302bb893 100644
--- a/file.c
+++ b/file.c
@@ -1745,8 +1745,8 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE 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;