]> git.plutz.net Git - lobster/commitdiff
suppress error for non-numerig comparisons
authorPaul Hänsch <paul@plutz.net>
Tue, 10 Dec 2019 11:23:58 +0000 (12:23 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 10 Dec 2019 11:23:58 +0000 (12:23 +0100)
index.cgi

index ef9c74778fab4626587dbb15727d35bec0420ec8..d4e3cb9c447d146b43dee193c743e28bdfb0913b 100755 (executable)
--- 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"