Further investigating . . .  I take it all back.

The suprise is on shade side which swallows first element in array (!) 
(I guess in standard C that's the command)

array_push works as expected and so does str_append.

Thanks and sorry to bother

    Torsten


> Moi,
>
> first time I'm suprised with ruby. It doesn't work. But surely I'm 
> doing something wrong.
>
> Problem seems to be: rb_ary_push  overwrites first element.
>
> So I have code like:  (argv is ARGV from ruby)
>
>  VALUE file_param = rb_str_new2("--disk_filename=");
>  file_param = rb_str_append( file_param , filename );
>  rb_ary_push( argv, file_param );
>  for(  i = 0 ; i < RARRAY(argv)->len ; i++ ){
>    av[i] = STR2CSTR(RARRAY(argv)->ptr[i] );
>  }
>  init_shades(RARRAY(argv)->len , av );
>
> but the init_shades only gets the filename string if I pass the 
> command line an argument (which is then overwritten).
> When I pass no argument, nothing gets through.
>
> Suprise. hm.
>
> Answers ?
>
> Thanks
>
>    Torsten
>