In depfile_up_to_date_dir() we need to check if name has a kmod
extension. "path" variable there will be the directory name, which
doesn't contain an extension.
Without this, "depmod -A" returns that the modules.dep is up to date,
even if it isn't.
In depmod_modules_search_file() it's pointless to compare the basename,
so pass only the name to be checked.
size_t modnamelen;
int err;
- if (!path_ends_with_kmod_ext(path, baselen + namelen))
+ if (!path_ends_with_kmod_ext(path + baselen, namelen))
return 0;
if (path_to_modname(path, modname, &modnamelen) == NULL) {
path);
closedir(subdir);
} else if (S_ISREG(st.st_mode)) {
- if (!path_ends_with_kmod_ext(path, namelen))
+ if (!path_ends_with_kmod_ext(name, namelen))
continue;
+
memcpy(path + baselen, name, namelen + 1);
err = st.st_mtime <= mtime;
if (err == 0) {