Fix the regexp evilness so that fdisk can (again?) find the device

root is on from the root mount path.

Spotted by:	imp
This commit is contained in:
Poul-Henning Kamp 2002-10-27 10:52:54 +00:00
parent b6f33850e0
commit a8ad364a7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106033

View File

@ -1342,7 +1342,7 @@ get_rootdisk(void)
if (statfs("/", &rootfs) == -1)
err(1, "statfs(\"/\")");
if ((rv = regcomp(&re, "^(/dev/.*)(\\d+(s\\d+)?[a-h])?$",
if ((rv = regcomp(&re, "^(/dev/[a-z]+[0-9]+)([sp][0-9]+)?[a-h]?$",
REG_EXTENDED)) != 0)
errx(1, "regcomp() failed (%d)", rv);
if ((rv = regexec(&re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0)