mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
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.
This commit is contained in:
1 parent
7b2ef2de20
commit
8ccfed2edc
1 file changed
+7
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user