From: Jérémie Astor Date: Sat, 30 Jan 2021 18:31:28 +0000 (+0100) Subject: :art: Internally rename template plugins X-Git-Tag: nightly~1013 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9c86550d4969109314a5fc279317877ed4647821;p=gwion.git :art: Internally rename template plugins --- diff --git a/src/plug.c b/src/plug.c index ca461900..2d811c92 100644 --- a/src/plug.c +++ b/src/plug.c @@ -155,8 +155,15 @@ 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); - const m_str name = (m_str)VKEY(map, i); - if(!strcmp(name, iname)) { + const m_str base = (m_str)VKEY(map, i); + const size_t size = strlen(iname); + char name[size + 1]; + strcpy(name, iname); + for(size_t i = 0; i < size; i++) { + if(name[i] == ':' || name[i] == '[' || name[i] == ']') + name[i] = '_'; + } + if(!strcmp(name, base)) { if(plug->imp) return GW_OK; const plugin imp = DLSYM(plug->dl, plugin, GWIMPORT_NAME);