Relax syntax requirements of source string

The original spec for the strings describing the PNP info didn't allow
spaces. Several times now people have broken the install by including
them. Relax the syntax to allow them after the ; which is where
people's muscle memory tends to put them.

Approved by: re@ (gjb)
This commit is contained in:
imp 2018-09-26 19:41:06 +00:00
parent e09f72f534
commit 7978d887d8

View File

@ -46,6 +46,7 @@
#include <sys/module.h>
#define FREEBSD_ELF
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fts.h>
@ -259,6 +260,9 @@ parse_pnp_list(const char *desc, char **new_desc, pnp_list *list)
strncpy(key, colon + 1, semi - colon - 1);
key[semi - colon - 1] = '\0';
walker = semi + 1;
/* Fail safe if we have spaces after ; */
while (walker < ep && isspace(*walker))
walker++;
} else {
if (strlen(colon + 1) >= sizeof(key))
goto err;