Skip to content

Commit

Permalink
Merge pull request elizagamedev#28 from rkevin-arch/fix-ruby-argv-war…
Browse files Browse the repository at this point in the history
…ning

Placate compiler warning about argv passed into ruby_options
  • Loading branch information
Speak2Erase committed Mar 21, 2021
2 parents 62650b6 + 82b5af5 commit d057e58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions binding-mri/binding-mri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,12 +615,13 @@ static void mriBindingExecute()
);

// we probably should only be calling this if we are a ruby executable
// but we need to initialize things like the prelude (provides important library functions like IO#read_nonblock
// Init_prelude is not exposed anywhere else
// but we need to initialize things like the prelude (provides important library functions like IO#read_nonblock
// Init_prelude is not exposed anywhere else

// the three arguments are the executable name, and the '-e ""' is to tell ruby to run an empty file
// otherwise (since this parses options for the ruby executable) it's gonna wait on stdin for code
char* options_argv[] = {"oneshot", "-e", "", NULL};
// the three arguments are the executable name, and the '-e ""' is to tell ruby to run an empty file
// otherwise (since this parses options for the ruby executable) it's gonna wait on stdin for code
char options_argv1[] = "oneshot", options_argv2[] = "-e", options_argv3[] = "";
char* options_argv[] = {options_argv1, options_argv2, options_argv3, NULL};
ruby_options(3, options_argv);

rb_enc_set_default_external(rb_enc_from_encoding(rb_utf8_encoding()));
Expand Down

0 comments on commit d057e58

Please sign in to comment.