From b493dec91ed7bc20b67e9b89a99398c9cf743d5e Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 2 Jul 2002 19:14:23 +0000 Subject: David Frascone noticed two problems. First, modprobe was trying to call 'insmod -q', which wasn't supported. Secondly, when modprobe was fed blank lines from modules.dep, we ended up calling xstrndup(ptr, -1), which with suitably bad results. David provided a patch to catch the blank lines, and I have added insmod -q support. So modprobe should work again. -Erik --- modutils/modprobe.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modutils/modprobe.c') diff --git a/modutils/modprobe.c b/modutils/modprobe.c index fbe18b640..b05158ac0 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -178,6 +178,10 @@ static struct dep_t *build_dep ( void ) if (( *(end-1) == '.' ) && ( *end == 'o' )) ext = 2; + + /* Cope with blank lines */ + if ((end-deps-ext+1) <= 0) + continue; dep = xstrndup ( deps, end - deps - ext + 1 ); -- cgit v1.2.3