Fix underscores() corner case (and optimise)
authorAlan Jenkins <alan@alan-eeepc.jenkins>
Fri, 20 Feb 2009 12:14:32 +0000 (12:14 +0000)
committerAlan Jenkins <alan@alan-eeepc.jenkins>
Fri, 20 Feb 2009 12:14:32 +0000 (12:14 +0000)
commitbff25540843a2a839f2474fa9d7dc2dce09bdf54
treebef418d9fdf47994b2917b0d673348239aeb68cc
parent36236143335c4391a078f4a2c12a831375d90606
Fix underscores() corner case (and optimise)

The pattern "[[]-" matches the string "[-".
underscores() should convert the pattern to "[[]_".

The current code gets this wrong, leaving it as "[[]-".
It seems to think patterns can include nested square brackets.
This shouldn't affect anyone, but it does makes it a bit faster.

Also, we can reduce the number of calls to underscores()
for non-matching aliases.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
depmod.c
modprobe.c