… | |
… | |
1199 | if (ent->type == EIO_DT_UNKNOWN) |
1199 | if (ent->type == EIO_DT_UNKNOWN) |
1200 | { |
1200 | { |
1201 | if (*name == '.') /* leading dots are likely directories, and, in any case, rare */ |
1201 | if (*name == '.') /* leading dots are likely directories, and, in any case, rare */ |
1202 | ent->score = 98; |
1202 | ent->score = 98; |
1203 | else if (!strchr (name, '.')) /* absense of dots indicate likely dirs */ |
1203 | else if (!strchr (name, '.')) /* absense of dots indicate likely dirs */ |
1204 | ent->score = len <= 2 ? len + 60 : len <= 4 ? 50 : len <= 7 ? 40 : 10; /* shorter == more likely dir, but avoid too many classes */ |
1204 | ent->score = len <= 2 ? len + 6 : len <= 4 ? 5 : len <= 7 ? 4 : 1; /* shorter == more likely dir, but avoid too many classes */ |
1205 | } |
1205 | } |
1206 | else if (ent->type == EIO_DT_DIR) |
1206 | else if (ent->type == EIO_DT_DIR) |
1207 | ent->score = 100; |
1207 | ent->score = 100; |
1208 | } |
1208 | } |
1209 | } |
1209 | } |