Fix softreq, so it reports when no suitable MD5 library is found

Tue, 25 Nov 2008 01:56:20 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 25 Nov 2008 01:56:20 +0000
changeset 407
7ae008771391
parent 406
11f176cae9da
child 408
eb1a0960cefb

Fix softreq, so it reports when no suitable MD5 library is found

util/hashes.lua file | annotate | diff | comparison | revisions
--- a/util/hashes.lua	Tue Nov 25 01:55:01 2008 +0000
+++ b/util/hashes.lua	Tue Nov 25 01:56:20 2008 +0000
@@ -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"

mercurial