Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/sundown-ffi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'env.lua')
-rw-r--r--env.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/env.lua b/env.lua
index 757de7c..37be420 100644
--- a/env.lua
+++ b/env.lua
@@ -2,6 +2,19 @@ local ffi = require 'ffi'
local sundown = {}
+-- Compat function from https://github.com/stevedonovan/Penlight/blob/master/lua/pl/compat.lua
+if not package.searchpath then
+ local sep = package.config:sub(1,1)
+ function package.searchpath (mod,path)
+ mod = mod:gsub('%.',sep)
+ for m in path:gmatch('[^;]+') do
+ local nm = m:gsub('?',mod)
+ local f = io.open(nm,'r')
+ if f then f:close(); return nm end
+ end
+ end
+end
+
sundown.C = ffi.load(package.searchpath('libsundown', package.cpath))
return sundown