Permalink
Browse files

Don't append PLATFORM_SPECIFIC_EXTENSION if it's already present in l…

…ibfile
  • Loading branch information...
1 parent d7c7bd1 commit 384867f7d173656ba64a68150922d5853e8d71f6 @raphaelr raphaelr committed with TooTallNate Mar 10, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/library.js
View
6 lib/library.js
@@ -7,8 +7,12 @@ var ffi = require('./ffi')
* ForeignFunction.
*/
function Library (libfile, funcs) {
+ if(libfile && libfile.indexOf(EXT) === -1) {
+ libfile += EXT
+ }
+
var lib = {}
- , dl = new ffi.DynamicLibrary(libfile ? libfile + EXT : null, RTLD_NOW)
+ , dl = new ffi.DynamicLibrary(libfile || null, RTLD_NOW)
if (funcs) {
Object.keys(funcs).forEach(function (func) {

0 comments on commit 384867f

Please sign in to comment.