]> git.corax.cc Git - toolbox/commitdiff
include/is: Rename is_digit() to is_digits()
authorMatthias Kruk <m@m10k.eu>
Tue, 20 Apr 2021 13:05:37 +0000 (22:05 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 20 Apr 2021 13:05:37 +0000 (22:05 +0900)
The name of the is_digit() function was originally taken from the
Standard C library function of the same name. However, that function
checks only a single character, while this function compares all
characters in a string. To avoid confusion, this commit renames the
function to is_digits().

include/is.sh

index ac22f820ae0a44c40dce8009b3183a0284c067bd..d0f804b7be1c99a46b117e6f94031551ef384d05 100644 (file)
@@ -4,7 +4,7 @@ __init() {
        return 0
 }
 
-is_digit() {
+is_digits() {
        local str
 
        str="$1"
@@ -69,7 +69,7 @@ is_alnum() {
 
        str="$1"
 
-       if is_alpha "$str" || is_digit "$str"; then
+       if is_alpha "$str" || is_digits "$str"; then
                return 0
        fi