From: Mischa POSLAWSKY Date: Thu, 2 Jun 2022 21:53:27 +0000 (+0200) Subject: common: silence warning in showlink about unused href X-Git-Tag: v1.14~78 X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/6e61c83476cae09e2a5d67742650a0f54c6bad9c common: silence warning in showlink about unused href --- diff --git a/common.inc.plp b/common.inc.plp index a1eb3e5..898e8bb 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -233,10 +233,9 @@ BEGIN { sub showlink { my ($title, $href, $selected) = @_; - return sprintf( - !$href ? '%s' : - $selected ? '%s' : '%s', - EscapeHTML($title), EscapeHTML($href) - ); + EscapeHTML($title); + return $title if not $href; + return "$title" if $selected; + return sprintf '%s', EscapeHTML($href), $title; }