cf->mtime = mtime;
cf->lastck = now;
cf->next = cflist;
+ cf->prev = NULL;
+ if(cflist != NULL)
+ cflist->prev = cf;
cflist = cf;
return(cf);
}
while((dent = readdir(dir)) != NULL) {
if((p = strchr(dent->d_name, '.')) == NULL)
continue;
- if(strncmp(dent->d_name, inm, p - dent->d_name))
+ if(strncmp(dent->d_name, inm, strlen(inm)))
continue;
ipath = sprintf2("%s/%s", path, dent->d_name);
if(stat(ipath, &sb) || !S_ISREG(sb.st_mode)) {
} else {
*(p2++) = 0;
}
+ if((tmp = unquoteurl(p)) == NULL) {
+ simpleerror(fd, 400, "Bad Request", "The requested URL contains an invalid escape sequence.");
+ goto fail;
+ }
+ strcpy(p, tmp);
+ free(tmp);
if(!*p) {
if(p2 == NULL) {