Fixed a couple of bugs in dirplex.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 26 Aug 2010 23:46:55 +0000 (01:46 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 26 Aug 2010 23:46:55 +0000 (01:46 +0200)
src/dirplex.c

index 01d8715..402d654 100644 (file)
@@ -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)) {