bool dir = !!(files[i]->d_type & DT_DIR);
if (name[0] == '.' && name[1] == 0)
- continue;
+ goto next;
sprintf(file, "%s", name);
if (stat(local_path, &s))
- continue;
+ goto next;
if (!dir) {
suffix = "";
}
if (!(s.st_mode & mode))
- continue;
+ goto next;
uh_chunk_printf(cl,
"<li><strong><a href='%s%s%s'>%s</a>%s"
type, s.st_size / 1024.0);
*file = 0;
+next:
free(files[i]);
}
}
!uh_file_if_range(cl, &pi->stat) ||
!uh_file_if_unmodified_since(cl, &pi->stat) ||
!uh_file_if_none_match(cl, &pi->stat)) {
- ustream_printf(cl->us, "Content-Length: 0\r\n");
ustream_printf(cl->us, "\r\n");
uh_request_done(cl);
close(fd);