installer: Fix disk_find() on systems that have both da1 and da10.
authorSascha Wildner <saw@online.de>
Thu, 29 May 2014 06:26:47 +0000 (08:26 +0200)
committerSascha Wildner <saw@online.de>
Thu, 29 May 2014 06:26:47 +0000 (08:26 +0200)
commita96dd72561007f315dbda98c8e06047f89f9ac50
treeb9a523fff1f06896bde829660690b51a51dfdfbf
parent6fcde577487867131c179f173622fc1d6d1dbd32
installer: Fix disk_find() on systems that have both da1 and da10.

In addition to comparing names (up to the length of the disk which
was found previously), also compare name lengths.

While here, remove the disk_find() check in disk_new(). disk_new()
didn't deal with it returning NULL. But because the list of disks
we offer as targets for installing is taken from sysctl kern.disks'
output, it will not have duplicates (else it would likely be a bug
in the kernel).

Reported-by: BSDUX on IRC
usr.sbin/installer/libinstaller/diskutil.c