From: Wincent Colaiuta Date: Mon, 5 Sep 2011 02:14:26 +0000 (-0700) Subject: Fix for Ruby 1.9: rb_block_given_p() no longer returns Qtrue X-Git-Tag: 1.2.1~3 X-Git-Url: https://git.wincent.com/mkdtemp.git/commitdiff_plain/eacc1d9404083b09fef7fd048bd1834128f47381 Fix for Ruby 1.9: rb_block_given_p() no longer returns Qtrue Signed-off-by: Wincent Colaiuta --- diff --git a/ext/mkdtemp.c b/ext/mkdtemp.c index 1f55abf..3654b51 100644 --- a/ext/mkdtemp.c +++ b/ext/mkdtemp.c @@ -106,7 +106,7 @@ static VALUE dir_mkdtemp_m(int argc, VALUE *argv, VALUE self) rb_raise(rb_eSystemCallError, "mkdtemp failed (error #%d: %s)", errno, strerror(errno)); // yield to block if given, inside Dir.chdir - if (rb_block_given_p() == Qtrue) + if (rb_block_given_p()) rb_iterate(call_chdir, template, yield_block, block); return template; }