Welcome to little lamb

Code » comain » commit 29d6248

libcomain: Fix stupid mistakes in vercmp

author Olivier Brunel
2023-01-25 13:51:42 UTC
committer Olivier Brunel
2023-01-25 13:51:42 UTC
parent b565f39c9057e5e5e7a003c50208bfe1c66e5710

libcomain: Fix stupid mistakes in vercmp

libcomain +2 -2

diff --git a/libcomain b/libcomain
index db53d75..1989da5 100644
--- a/libcomain
+++ b/libcomain
@@ -96,8 +96,8 @@ vercmp()
     while test $i -le $n; do
         n1="$(echo $got |cut -d. -f$i)"
         n2="$(echo $need|cut -d. -f$i)"
-        if test -z "$(echo $n1|tr -d '[:alpha:]')" \
-            && test -z "$'echo $n2|tr -d '[:alpha:]')"; then
+        if test -z "$(echo $n1|tr -d '[:digit:]')" \
+            && test -z "$(echo $n2|tr -d '[:digit:]')"; then
             if test $n1 -lt $n2; then
                 echo -1
                 return