From 13552a002b70d5dd7035e3f24f276646b705b729 Mon Sep 17 00:00:00 2001 From: Brain2000 Date: Mon, 20 Jul 2020 13:39:11 -0400 Subject: [PATCH] Adjust is_positive_integer so values with leading 0's, such as '001' will return 1 (#2) --- usr/lib/hacking-bash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/hacking-bash.sh b/usr/lib/hacking-bash.sh index f705421..481930c 100644 --- a/usr/lib/hacking-bash.sh +++ b/usr/lib/hacking-bash.sh @@ -234,7 +234,7 @@ function is_positive_integer { (( $# < 1 )) && return 1 - [[ $1 =~ ^([1-9][0-9]*|0)$ ]] && return 0 + [[ $1 =~ ^([0-9]+)$ ]] && return 0 return 1 }