svn commit: r295105 - head/usr.sbin/bsdconfig/share
Devin Teske
dteske at FreeBSD.org
Sun Jan 31 21:33:25 UTC 2016
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
More information about the svn-src-all
mailing list