commit 7b9683b
Randy Palamar
·
2024-01-03 01:11:44 +0000 UTC
parent 870ef94
fix tail component replacement in man() for old lua gsub/gmatch behaved differently prior to lua5.3 and thus cannot be used with the same semantics in luajit/older lua.
1 files changed,
+2,
-1
+2,
-1
1@@ -491,7 +491,8 @@ function man(srcs, section)
2 end
3 local srcsection = section or src:match('[^.]*$')
4 local i = src:find('/', 1, true)
5- local gz = '$outdir'..src:sub(i):gsub('[^.]*$', srcsection)..'.gz'
6+ local j = src:reverse():find('.', 1, true)
7+ local gz = '$outdir'..src:sub(i, #src - j + 1)..srcsection..'.gz'
8 build('gzip', gz, src)
9 file('share/man/man'..srcsection..'/'..gz:match('[^/]*$'), '644', gz)
10 end