From: Matthias Kruk Date: Tue, 20 Apr 2021 13:05:37 +0000 (+0900) Subject: include/is: Rename is_digit() to is_digits() X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=c4e3cdf090344e2d81a339db05f70de3fd010546;p=toolbox include/is: Rename is_digit() to is_digits() 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(). --- diff --git a/include/is.sh b/include/is.sh index ac22f82..d0f804b 100644 --- a/include/is.sh +++ b/include/is.sh @@ -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