mdev: fix counting of '%' in pattern
This commit is contained in:
parent
ff9234948e
commit
e94a87134d
@ -180,8 +180,9 @@ static void make_device(char *path, int delete)
|
|||||||
/* substitute %1..9 with off[1..9], if any */
|
/* substitute %1..9 with off[1..9], if any */
|
||||||
n = 0;
|
n = 0;
|
||||||
s = val;
|
s = val;
|
||||||
while (*s && *s++ == '%')
|
while (*s)
|
||||||
n++;
|
if (*s++ == '%')
|
||||||
|
n++;
|
||||||
|
|
||||||
p = alias = xzalloc(strlen(val) + n * strlen(device_name));
|
p = alias = xzalloc(strlen(val) + n * strlen(device_name));
|
||||||
s = val + 1;
|
s = val + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user