From 262023b088b9e1904a81f2d4b9ff83f3aa880b55 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Fri, 25 Jul 2014 00:28:16 +0200 Subject: [PATCH] MRI-Binding: Fix typo and don't set $LOAD_PATH (thanks @cremno) '$:' and '$LOAD_PATH' point to the same array. --- binding-mri/binding-mri.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index ea0d5f2..2a90e8e 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -398,17 +398,6 @@ static void showExc(VALUE exc) showMsg(StringValueCStr(ms)); } -/* Appends if exists, sets if not */ -static void globalAryAppend(const char *globalName, VALUE ary) -{ - VALUE existing = rb_gv_get(globalName); - - if (NIL_P(existing)) - rb_gv_set(globalName, ary); - else - rb_ary_concat(existing, ary); -} - static void mriBindingExecute() { ruby_setup(); @@ -429,8 +418,7 @@ static void mriBindingExecute() rb_ary_push(lpaths, pathv); } - globalAryAppend("$", lpaths); - globalAryAppend("LOAD_PATH", lpaths); + rb_ary_concat(rb_gv_get(":"), lpaths); } RbData rbData;