From a5979f0bd50234ff9cad47f160d121628e0e3bbe Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 29 Mar 2023 01:17:50 +0100 Subject: [PATCH] man: fix shellcheck warning for html.in SC2015: Note that A && B || C is not if-then-else. C may run when A is true. --- man/html.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/html.in b/man/html.in index 5e545b7412..aaff9d1383 100755 --- a/man/html.in +++ b/man/html.in @@ -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" -- 2.25.1