]> git.wincent.com - mkdtemp.git/commitdiff
Fix for Ruby 1.9: rb_block_given_p() no longer returns Qtrue
authorWincent Colaiuta <win@wincent.com>
Mon, 5 Sep 2011 02:14:26 +0000 (19:14 -0700)
committerWincent Colaiuta <win@wincent.com>
Mon, 5 Sep 2011 02:14:26 +0000 (19:14 -0700)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/mkdtemp.c

index 1f55abf75c95c9288904d5eab459e8bf65b77aa9..3654b51724d001d5d7afd54435c8364feb50fa3d 100644 (file)
@@ -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
         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;
 }
         rb_iterate(call_chdir, template, yield_block, block);
     return template;
 }