aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 02:25:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 02:25:12 +0000
commitfc0c2d1cc2f4ec1fb15c73e91cc8aa8d19854c8a (patch)
tree46a96ea9047262f1186214dcede563bfbb879be2 /ruby.c
parentd6beaf3215602eac993bebc1aa1bf9b21c947d63 (diff)
downloadruby-fc0c2d1cc2f4ec1fb15c73e91cc8aa8d19854c8a.tar.gz
version.c: remove ruby_engine_name
* ruby.c (load_file_internal, ruby_process_options): share ruby_engine instead of literal strings. * version.c (Init_version): remove internal `ruby_engine_name`, but set the VM program name in addition to the global constant. * vm_backtrace.c (location_to_str, oldbt_init): use th eVM program name always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby.c b/ruby.c
index 6468ef9710..56ad6c4442 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1678,7 +1678,7 @@ load_file_internal(VALUE argp_v)
if (RSTRING_LEN(line) > 2
&& RSTRING_PTR(line)[0] == '#'
&& RSTRING_PTR(line)[1] == '!') {
- if ((p = strstr(RSTRING_PTR(line), "ruby")) != 0) {
+ if ((p = strstr(RSTRING_PTR(line), ruby_engine)) != 0) {
goto start_read;
}
}
@@ -1694,7 +1694,7 @@ load_file_internal(VALUE argp_v)
if (NIL_P(line))
return 0;
- if ((p = strstr(RSTRING_PTR(line), "ruby")) == 0) {
+ if ((p = strstr(RSTRING_PTR(line), ruby_engine)) == 0) {
/* not ruby script, assume -x flag */
goto search_shebang;
}
@@ -2083,7 +2083,7 @@ ruby_process_options(int argc, char **argv)
{
struct cmdline_options opt;
VALUE iseq;
- const char *script_name = (argc > 0 && argv[0]) ? argv[0] : "ruby";
+ const char *script_name = (argc > 0 && argv[0]) ? argv[0] : ruby_engine;
ruby_script(script_name); /* for the time being */
rb_argv0 = rb_str_new4(rb_progname);