summaryrefslogtreecommitdiff
path: root/usr.sbin/bsdconfig
diff options
context:
space:
mode:
authorDevin Teske <dteske@FreeBSD.org>2016-01-31 21:33:24 +0000
committerDevin Teske <dteske@FreeBSD.org>2016-01-31 21:33:24 +0000
commit92db38426f0ea353264ccf4d2e76bb57783687f6 (patch)
tree592f12731966de841c1e08b8c4c8dd97ab3bd011 /usr.sbin/bsdconfig
parente4f08d49c1cbceff5abca304c1daa4aa127996b3 (diff)
downloadsrc-test2-92db38426f0ea353264ccf4d2e76bb57783687f6.tar.gz
src-test2-92db38426f0ea353264ccf4d2e76bb57783687f6.zip
Move f_isinteger() to the top
Grouping builtins-only algos together
Notes
Notes: svn path=/head/; revision=295105
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 1e78b755e3a6..093084514558 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