Subject: Re: install/37498: bug in MAKEDEV
To: None <install-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Alan Barrett <apb@netbsd.org>
List: netbsd-bugs
Date: 12/08/2007 17:30:06
The following reply was made to PR install/37498; it has been noted by GNATS.

From: Alan Barrett <apb@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: netbsd-bugs@netbsd.org
Subject: Re: install/37498: bug in MAKEDEV
Date: Sat, 8 Dec 2007 19:29:36 +0200

 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)