Fix softreq, so it reports when no suitable MD5 library is found
authorMatthew Wild <mwild1@gmail.com>
Tue, 25 Nov 2008 01:56:20 +0000 (01:56 +0000)
committerMatthew Wild <mwild1@gmail.com>
Tue, 25 Nov 2008 01:56:20 +0000 (01:56 +0000)
util/hashes.lua

index 5ed9d3acfd73bf7f17bd24379158556eb12220ef..2fd0fbd87dda16aee524adb29ba657c829524bca 100644 (file)
@@ -1,5 +1,5 @@
 
-local softreq = function (...) return select(2, pcall(require, ...)); end
+local softreq = function (...) local ok, lib =  pcall(require, ...); if ok then return lib; else return nil; end end
 local error = error;
 
 module "hashes"