]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man/html: fix invocation for pages which are *not* symlinks
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 Sep 2020 12:24:01 +0000 (14:24 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 Sep 2020 12:43:12 +0000 (14:43 +0200)
It seems I tested that redirects work, but I forgot to check that non-redirects
are still fine too ;(

man/html.in

index 23b77ebbb068bfe703d6a99ad49cbb450c2df6fc..c142f581de010f4002c07976215d932bcb3b6bc2 100755 (executable)
@@ -13,7 +13,7 @@ target="man/$1.html"
 ninja -C "@BUILD_ROOT@" "$target"
 
 fullname="@BUILD_ROOT@/$target"
-redirect="$(readlink "$fullname" 2>/dev/null)"
+redirect="$(test -f "$fullname" && readlink "$fullname" || :)"
 if [ -n "$redirect" ]; then
     ninja -C "@BUILD_ROOT@" "man/$redirect"