summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-10-18 17:09:45 +0000
committerdteske <dteske@FreeBSD.org>2012-10-18 17:09:45 +0000
commit08df5b7fb0ae9ca1ad211220be28a218cc292d3a (patch)
tree18d86ac48f9ac3ef9f50d45ecfd4e40424cf25d9
parent1704468a31b5e651af0945f2a6ef03fd0ba23365 (diff)
downloadFreeBSD-src-08df5b7fb0ae9ca1ad211220be28a218cc292d3a.zip
FreeBSD-src-08df5b7fb0ae9ca1ad211220be28a218cc292d3a.tar.gz
Fix a bug where blank lines were not being counted (because awk's split()
function returns zero when $0 is the NULL string). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor)
-rw-r--r--usr.sbin/bsdconfig/share/strings.subr2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr
index 1a330ad..d11a9a2 100644
--- a/usr.sbin/bsdconfig/share/strings.subr
+++ b/usr.sbin/bsdconfig/share/strings.subr
@@ -75,7 +75,7 @@ f_longest_line_length()
f_number_of_lines_awk='
BEGIN { num_lines = 0 }
{
- num_lines += split($0, unused, /\\n/)
+ num_lines += split(" "$0, unused, /\\n/)
}
END { print num_lines }
'
OpenPOWER on IntegriCloud