Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
GLIBC does not provide dp_namlen
Baptiste Daroussin committed 9 years ago
commit 91ddc55186df3b754e11d7ad1d5e40785405f554
parent e681030
1 file changed +4 -2
modified libpkg/pkg_config.c
@@ -753,14 +753,16 @@ static int
configfile(const struct dirent *dp)
{
	const char *p;
+
	size_t n;

	if (dp->d_name[0] == '.')
		return (0);

-
	if (dp->d_namlen <= 5)
+
	n = strlen(dp->d_name);
+
	if (n <= 5)
		return (0);

-
	p = &dp->d_name[dp->d_namlen - 5];
+
	p = &dp->d_name[n - 5];
	if (strcmp(p, ".conf") != 0)
		return (0);
	return (1);