]> git.corax.cc Git - toolbox/commitdiff
include/opt: Fix C-ish statement
authorMatthias Kruk <matthias.kruk@miraclelinux.com>
Thu, 20 May 2021 00:58:31 +0000 (09:58 +0900)
committerMatthias Kruk <matthias.kruk@miraclelinux.com>
Thu, 20 May 2021 00:58:31 +0000 (09:58 +0900)
The statement used to store the length of the longest option name in
opt_add_arg() looks very C-like, meaning it doesn't work correctly in
bash. This commit changes the statement to proper shell syntax.

include/opt.sh

index ea67f7f959cf9dd7425bf5c4f7ef7577d38cc606..76bc0c87fb7d2c74e9eeae5288e78258e658df9d 100644 (file)
@@ -90,7 +90,7 @@ opt_add_arg() {
        __opt_map["--$long"]="$long"
 
        if (( __opt_longest < optlen )); then
-               __opt_longest=optlen;
+               __opt_longest="$optlen"
        fi
 
        ((__opt_num++))