summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-02-08 05:54:13 -0700
committerMichael Forney <mforney@mforney.org>2024-02-08 16:12:05 -0800
commit59de97e9412dab937702d9d9d1f91fa6c6fcb562 (patch)
tree49c0d9fbf1d2abf91ee15d2dffa5fc5d8432ce35
parent1a287f0fbda34a390cf85eb1e16c5e1f6c6871a9 (diff)
man: don't duplicate section extension
-rw-r--r--ninja.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/ninja.lua b/ninja.lua
index 7481be4d..7b6ed3eb 100644
--- a/ninja.lua
+++ b/ninja.lua
@@ -494,15 +494,15 @@ function man(srcs, section)
local base = src:match('[^/]*$')
local ext = base:match('%.([^.]*)$')
- if section then
- if ext then base = base:sub(1, -(#ext + 2)) end
- ext = section
- end
+ if ext then base = base:sub(1, -(#ext + 2)) end
+ if section then ext = section end
+ local path = 'share/man/man'..ext..'/'..base..'.'..ext
if config.gzman ~= false then
build('gzip', out, src)
src = out
+ path = path..'.gz'
end
- file('share/man/man'..ext..'/'..base..'.'..ext, '644', src)
+ file(path, '644', src)
end
end