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 }
 '
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to