Skip to content

Commit 13552a0

Browse files
authored
Adjust is_positive_integer so values with leading 0's, such as '001' will return 1 (#2)
1 parent 5e25c42 commit 13552a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

usr/lib/hacking-bash.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function is_positive_integer
234234
{
235235
(( $# < 1 )) && return 1
236236

237-
[[ $1 =~ ^([1-9][0-9]*|0)$ ]] && return 0
237+
[[ $1 =~ ^([0-9]+)$ ]] && return 0
238238

239239
return 1
240240
}

0 commit comments

Comments
 (0)