-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathldoc.patch
27 lines (26 loc) · 949 Bytes
/
ldoc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/ldoc.lua 2016-11-07 09:20:55.000000000 -0500
+++ b/ldoc.lua 2023-01-26 09:53:47.446847946 -0500
@@ -15,7 +15,10 @@
-- @copyright 2011
-- @license MIT/X11
-- @script ldoc
+local dir = arg[0]:match('^(.+)[/\\]')
+package.path = string.format('%s/?.lua;%s/?/init.lua', dir, dir)
+
local class = require 'pl.class'
local app = require 'pl.app'
local path = require 'pl.path'
--- a/ldoc/tools.lua 2016-11-07 09:20:55.000000000 -0500
+++ b/ldoc/tools.lua 2023-01-26 09:53:47.446847946 -0500
@@ -266,7 +266,10 @@
end
local lpath,cnt = fname:gsub('^'..utils.escape(basename),'')
--print('deduce',lpath,cnt,basename)
- if cnt ~= 1 then quit("module(...) name deduction failed: base "..basename.." "..fname) end
+ if cnt ~= 1 then
+ print("module(...) name deduction failed: base "..basename.." "..fname)
+ return '_UNKNOWN'
+ end
lpath = lpath:gsub(path.sep,'.')
return (M.name_of(lpath):gsub('%.init$',''))
end