@@ -550,7 +550,7 @@ attribute_hidden SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
550550 SEXP args0 = args , ans , tok , x ;
551551 R_xlen_t i , itok , len , tlen ;
552552 size_t j , ntok ;
553- int fixed_opt , perl_opt , useBytes ;
553+ Rboolean fixed_opt , perl_opt , useBytes ;
554554 char * pt = NULL ; wchar_t * wpt = NULL ;
555555 const char * buf , * split = "" , * bufp ;
556556 const unsigned char * tables = NULL ;
@@ -562,12 +562,9 @@ attribute_hidden SEXP do_strsplit(SEXP call, SEXP op, SEXP args, SEXP env)
562562 checkArity (op , args );
563563 x = CAR (args ); args = CDR (args );
564564 tok = CAR (args ); args = CDR (args );
565- fixed_opt = asLogical (CAR (args )); args = CDR (args );
566- perl_opt = asLogical (CAR (args )); args = CDR (args );
567- useBytes = asLogical (CAR (args ));
568- if (fixed_opt == NA_INTEGER ) fixed_opt = 0 ;
569- if (perl_opt == NA_INTEGER ) perl_opt = 0 ;
570- if (useBytes == NA_INTEGER ) useBytes = 0 ;
565+ fixed_opt = asRbool (CAR (args ), call ); args = CDR (args );
566+ perl_opt = asRbool (CAR (args ), call ); args = CDR (args );
567+ useBytes = asRbool (CAR (args ), call );
571568 if (fixed_opt && perl_opt ) {
572569 warning (_ ("argument '%s' will be ignored" ), "perl = TRUE" );
573570 perl_opt = 0 ;
0 commit comments