The filtering logic was completely skipping any entry which was 3
characters or shorter. Instead change the logic to only attempt to parse
those entries longer than 3 characters.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
while ((dirent = readdir(dir))) {
char *entry = dirent->d_name;
- if (strlen(entry) <= 3)
- continue;
- entry += 3;
+ if (strlen(entry) > 3) {
+ entry += 3;
- /* Don't emit entries we already filtered above. */
- if (isdigit(*entry))
- continue;
+ /* Don't emit entries we already filtered above. */
+ if (isdigit(*entry))
+ continue;
+ }
if (dirent_fillerat(filler, dir, dirent, buf, 0) != 0)
return -ENOENT;