Date: Thu, 18 Oct 2012 17:09:46 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241700 - head/usr.sbin/bsdconfig/share Message-ID: <201210181709.q9IH9k28083167@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 } '
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210181709.q9IH9k28083167>