]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: fix shellcheck warning for html.in
authorLuca Boccassi <bluca@debian.org>
Wed, 29 Mar 2023 00:17:50 +0000 (01:17 +0100)
committerLuca Boccassi <bluca@debian.org>
Wed, 29 Mar 2023 01:08:18 +0000 (02:08 +0100)
SC2015: Note that A && B || C is not if-then-else. C may run when A is true.

man/html.in

index 5e545b741282a3d40c5676050b312f85afdbac8c..aaff9d138382f4c38ac1d367e3e2d892ba24aed4 100755 (executable)
@@ -14,7 +14,11 @@ target="man/$1.html"
 ninja -C "@BUILD_ROOT@" "$target"
 
 fullname="@BUILD_ROOT@/$target"
-redirect="$(test -f "$fullname" && readlink "$fullname" || :)"
+if [ -f "$fullname" ]; then
+    redirect="$(readlink "$fullname" || :)"
+else
+    redirect=""
+fi
 if [ -n "$redirect" ]; then
     ninja -C "@BUILD_ROOT@" "man/$redirect"