From: fennecdjay Date: Wed, 4 Nov 2020 08:49:07 +0000 (+0100) Subject: :art: Small fixes X-Git-Tag: nightly~1215 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=72135b8ba56d42ecf801c010d2af5a31a2e637e6;p=gwion.git :art: Small fixes --- diff --git a/src/import/import_internals.c b/src/import/import_internals.c index 69438f01..8ddc53b0 100644 --- a/src/import/import_internals.c +++ b/src/import/import_internals.c @@ -29,8 +29,11 @@ ANN void gwi_reset(const Gwi gwi) { } ANN m_bool gwi_run(const Gwion gwion, m_bool (*f)(const Gwi)) { + const m_str name = gwion->env->name; struct loc_t_ loc = {}; OperCK oper = {}; struct Gwi_ gwi = { .gwion=gwion, .loc=&loc, .oper=&oper }; - return f(&gwi); + const m_bool ret = f(&gwi); + gwion->env->name = name; + return ret; } diff --git a/src/plug.c b/src/plug.c index 619e6377..b7694be1 100644 --- a/src/plug.c +++ b/src/plug.c @@ -174,10 +174,10 @@ ANN m_bool plugin_ini(struct Gwion_ *gwion, const m_str iname) { const Map map = &gwion->data->plug; for(m_uint i = 0; i < map_size(map); ++i) { const Plug plug = (Plug)VVAL(map, i); - if(plug->imp) - return GW_OK; const m_str name = (m_str)VKEY(map, i); if(!strcmp(name, iname)) { + if(plug->imp) + return GW_OK; const plugin imp = DLSYM(plug->dl, plugin, GWIMPORT_NAME); if(!imp) break;