Date: Sun, 31 Jan 2016 21:33:24 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295105 - head/usr.sbin/bsdconfig/share Message-ID: <201601312133.u0VLXOZB006779@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dteske Date: Sun Jan 31 21:33:24 2016 New Revision: 295105 URL: https://svnweb.freebsd.org/changeset/base/295105 Log: Move f_isinteger() to the top Grouping builtins-only algos together Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Sun Jan 31 21:31:24 2016 (r295104) +++ head/usr.sbin/bsdconfig/share/strings.subr Sun Jan 31 21:33:24 2016 (r295105) @@ -52,6 +52,16 @@ VALID_VARNAME_CHARS="0-9ABCDEFGHIJKLMNOP ############################################################ FUNCTIONS +# f_isinteger $arg +# +# Returns true if argument is a positive/negative whole integer. +# +f_isinteger() +{ + local arg="${1#-}" + [ "${arg:-x}" = "${arg%[!0-9]*}" ] +} + # f_substr [-v $var_to_set] $string $start [$length] # # Similar to awk(1)'s substr(), return length substring of string that begins @@ -267,16 +277,6 @@ f_number_of_lines() awk "$f_number_of_lines_awk" } -# f_isinteger $arg -# -# Returns true if argument is a positive/negative whole integer. -# -f_isinteger() -{ - local arg="${1#-}" - [ "${arg:-x}" = "${arg%[!0-9]*}" ] -} - # f_uriencode [$text] # # Encode $text for the purpose of embedding safely into a URL. Non-alphanumeric
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601312133.u0VLXOZB006779>