deciding whether to use entry->d_namlen or strlen(entry->d_name). Addresses PR 40477 by Robert Millan.