summaryrefslogtreecommitdiffhomepage
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-02 19:14:23 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-02 19:14:23 +0000
commitb493dec91ed7bc20b67e9b89a99398c9cf743d5e (patch)
treec665f9a7518ca63cac043553747c1902dd74bf93 /modutils/modprobe.c
parent69d41787089e7270b92c61165fd52a59a43a60fe (diff)
David Frascone <dave@frascone.com> 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
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r--modutils/modprobe.c4
1 files changed, 4 insertions, 0 deletions
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 );