mirror of https://github.com/nodejs/node.git
node: s/-/_/ in add-on symbol name
Replace dashes with underscores. When loading foo-bar.node, look for foo_bar_module, not foo-bar_module. The latter is not a legal symbol name.pull/24504/head
parent
7b2ef2de20
commit
8ccfed2edc
|
@ -1933,6 +1933,13 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
|
|||
return ThrowException(exception);
|
||||
}
|
||||
|
||||
/* Replace dashes with underscores. When loading foo-bar.node,
|
||||
* look for foo_bar_module, not foo-bar_module.
|
||||
*/
|
||||
for (pos = symbol; *pos != '\0'; ++pos) {
|
||||
if (*pos == '-') *pos = '_';
|
||||
}
|
||||
|
||||
node_module_struct *mod;
|
||||
if (uv_dlsym(&lib, symbol, reinterpret_cast<void**>(&mod))) {
|
||||
char errmsg[1024];
|
||||
|
|
Loading…
Reference in New Issue