summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2016-01-31 21:33:24 +0000
committerdteske <dteske@FreeBSD.org>2016-01-31 21:33:24 +0000
commit5a5c0e7cfee968bb2f62f27d5de3671f2c170845 (patch)
tree592f12731966de841c1e08b8c4c8dd97ab3bd011 /usr.sbin/bsdconfig
parent787316176728e376efcc9bfaee26d2d429e11a14 (diff)
downloadFreeBSD-src-5a5c0e7cfee968bb2f62f27d5de3671f2c170845.zip
FreeBSD-src-5a5c0e7cfee968bb2f62f27d5de3671f2c170845.tar.gz
Move f_isinteger() to the top
Grouping builtins-only algos together
Diffstat (limited to 'usr.sbin/bsdconfig')
-rw-r--r--usr.sbin/bsdconfig/share/strings.subr20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr
index 1e78b75..0930845 100644
--- a/usr.sbin/bsdconfig/share/strings.subr
+++ b/usr.sbin/bsdconfig/share/strings.subr
@@ -52,6 +52,16 @@ VALID_VARNAME_CHARS="0-9ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
############################################################ 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
OpenPOWER on IntegriCloud