diff options
Diffstat (limited to 'usr.sbin/bsdconfig/share/strings.subr')
-rw-r--r-- | usr.sbin/bsdconfig/share/strings.subr | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr index 25cceee..9b0014f 100644 --- a/usr.sbin/bsdconfig/share/strings.subr +++ b/usr.sbin/bsdconfig/share/strings.subr @@ -188,15 +188,8 @@ f_number_of_lines() # f_isinteger() { - local arg="$1" - - # Prevent division-by-zero - [ "$arg" = "0" ] && return $SUCCESS - - # Attempt to perform arithmetic divison (an operation which will exit - # with error unless arg is a valid positive/negative whole integer). - # - ( : $((0/$arg)) ) > /dev/null 2>&1 + local arg="${1#-}" + [ "${arg:-x}" = "${arg#[!0-9]*}" ] } # f_uriencode [$text] |