Hi all,

I asked this on ruby-talk, but I thought I should ask here as well.

I find I'm often doing something like this:

static VALUE foofoo(int argc, VALUE* argv, VALUE self)
   char* foo;
   VALUE rbFoo;
   ...

   rb_scan_args(argc,argv,"01",&rbFoo);

   if(NIL_P(rbFoo)){
      foo = NULL;
   }
   else{
      foo = StringValuePtr(rbFoo);
   }

   some_C_function(foo);
   return WHATEVER;
}
/* END */

Is there a way to reduce this to a single step?  Can we modify
StringValuePtr() to return NULL if its argument is nil?  Or would that
break too many things?

Regards,

Dan