Subject: Re: install/37498: bug in MAKEDEV
To: None <gnats-bugs@netbsd.org>
From: Alan Barrett <apb@netbsd.org>
List: netbsd-bugs
Date: 12/08/2007 19:29:36
On Sat, 08 Dec 2007, David Laight wrote:
>  >     count_nodes=$(($count_nodes + $(sh "$0.local" $opts -s all | wc -l)))

Sorry, we can't rely on "wc -l" being available.  MAKEDEV is sometimes
called from init(8) before the /usr file system is mounted.

>  or:
>  	oifs="$IFS"
>  	IFS='\n'
>  	set -- `sh "$0.local" $opts -s all`
>  	count_nodes=$((count_nodes + $#))
>  	IFS="$oifs"
>  (Except that getting \n into IFS isn;t that easy)

Getting a newline into IFS is easy enough.  I just checked in a fix
based on this idea, but using a shell function to count the lines.

--apb (Alan Barrett)