From ed436baad43d9eed7744ab0c95563359f37e67ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 10 Dec 2019 12:23:58 +0100 Subject: [PATCH] suppress error for non-numerig comparisons --- index.cgi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.cgi b/index.cgi index ef9c747..d4e3cb9 100755 --- a/index.cgi +++ b/index.cgi @@ -18,8 +18,16 @@ ACTION="$(GET a)" message="$(COOKIE message)" [ "$message" ] && SET_COOKIE 0 message='' -checked(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'checked="checked"' 2>/dev/null; } -selected(){ [ "$1" = "$2" ] || [ "$1" -eq "$2" ] && printf 'selected="selected"' 2>/dev/null; } +checked(){ + if [ "$1" = "$2" ] || [ "$1" -eq "$2" ]; then + printf 'checked="checked"' + fi 2>/dev/null +} +selected(){ + if [ "$1" = "$2" ] || [ "$1" -eq "$2" ]; then + printf 'selected="selected"' + fi 2>/dev/null +} yield_page() { local class="$1" style="$2" -- 2.39.2