polish load loop

parent 6513b72b
......@@ -639,12 +639,12 @@ tus_file_load(struct VPFX(tus_server) *srv)
dir = fdopendir(dup(basefd));
AN(dir);
ent = readdir(dir);
while (ent != NULL) {
if (strncmp(ent->d_name, TUS_FILE_PFX, strlen(TUS_FILE_PFX)) == 0 &&
ent->d_type == DT_REG)
tus_file_add(srv, basefd, ent->d_name);
ent = readdir(dir);
while ((ent = readdir(dir)) != NULL) {
if (strncmp(ent->d_name, TUS_FILE_PFX, strlen(TUS_FILE_PFX)))
continue;
if (ent->d_type != DT_REG)
continue;
tus_file_add(srv, basefd, ent->d_name);
}
AZ(closedir(dir));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment