diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -842,10 +842,10 @@ continue; /* * Skip files that generate errors like .debug, .symbol and .pkgsave - * by generally skipping all files with 2 dots. + * by generally skipping all files not ending with ".ko". */ - dot = strchr(p->fts_name, '.'); - if (dot && strchr(dot + 1, '.') != NULL) + dot = strrchr(p->fts_name, '.'); + if (dot == NULL || strcmp(dot, ".ko") != 0) continue; read_kld(p->fts_path, p->fts_name); }