Skip to content

Commit

Permalink
Allow for older ruby builds where RARRAY_LEN is not defined
Browse files Browse the repository at this point in the history
git-svn-id: http://rubyeventmachine.com/svn/trunk@803 2c60eb90-88cd-488e-9351-1edcb1d70dbc
  • Loading branch information
raggi committed Nov 28, 2008
1 parent 765534a commit a9cee38
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/rubymain.cpp
Expand Up @@ -463,7 +463,12 @@ t_invoke_popen

static VALUE t_invoke_popen (VALUE self, VALUE cmd)
{
int len = RARRAY_LEN(cmd);
// 1.8.7+
#ifdef RARRAY_LEN
int len = RARRAY_LEN(cmd);
#else
int len = RARRAY (cmd)->len;
#endif
if (len > 98)
rb_raise (rb_eRuntimeError, "too many arguments to popen");
char *strings [100];
Expand Down

0 comments on commit a9cee38

Please sign in to comment.