From d245c327ec854a63b6c6a6c90bd26c88d1a7ddaf Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Fri, 27 Aug 2010 01:46:55 +0200 Subject: [PATCH] Fixed a couple of bugs in dirplex. --- src/dirplex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dirplex.c b/src/dirplex.c index 01d8715..402d654 100644 --- a/src/dirplex.c +++ b/src/dirplex.c @@ -302,6 +302,9 @@ static struct config *getconfig(char *path) cf->mtime = mtime; cf->lastck = now; cf->next = cflist; + cf->prev = NULL; + if(cflist != NULL) + cflist->prev = cf; cflist = cf; return(cf); } @@ -445,7 +448,7 @@ static void handledir(struct hthead *req, int fd, char *path) 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)) { -- 2.11.0