summaryrefslogtreecommitdiff
path: root/version.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 02:25:12 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-29 02:25:12 (GMT)
commitfc0c2d1cc2f4ec1fb15c73e91cc8aa8d19854c8a (patch)
tree46a96ea9047262f1186214dcede563bfbb879be2 /version.c
parentd6beaf3215602eac993bebc1aa1bf9b21c947d63 (diff)
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 'version.c')
-rw-r--r--version.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/version.c b/version.c
index 0aafa92..6caf912 100644
--- a/version.c
+++ b/version.c
@@ -33,7 +33,6 @@ const int ruby_patchlevel = RUBY_PATCHLEVEL;
const char ruby_description[] = RUBY_DESCRIPTION;
const char ruby_copyright[] = RUBY_COPYRIGHT;
const char ruby_engine[] = "ruby";
-VALUE ruby_engine_name = Qnil;
/*! Defines platform-depended Ruby-level constants */
void
@@ -42,6 +41,7 @@ Init_version(void)
enum {ruby_patchlevel = RUBY_PATCHLEVEL};
enum {ruby_revision = RUBY_REVISION};
VALUE version;
+ VALUE ruby_engine_name;
/*
* The running version of ruby
*/
@@ -75,6 +75,7 @@ Init_version(void)
* The engine or interpreter this ruby uses.
*/
rb_define_global_const("RUBY_ENGINE", ruby_engine_name = MKSTR(engine));
+ ruby_set_script_name(ruby_engine_name);
/*
* The version of the engine or interpreter this ruby uses.
*/