svn commit: r241700 - head/usr.sbin/bsdconfig/share

Devin Teske dteske at FreeBSD.org
Thu Oct 18 17:09:46 UTC 2012


Author: dteske
Date: Thu Oct 18 17:09:45 2012
New Revision: 241700
URL: http://svn.freebsd.org/changeset/base/241700

Log:
  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)

Modified:
  head/usr.sbin/bsdconfig/share/strings.subr

Modified: head/usr.sbin/bsdconfig/share/strings.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/strings.subr	Thu Oct 18 16:34:00 2012	(r241699)
+++ head/usr.sbin/bsdconfig/share/strings.subr	Thu Oct 18 17:09:45 2012	(r241700)
@@ -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 }
 '


More information about the svn-src-head mailing list