X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmds.c;h=a2e047bc51eef0a54ffc3d8d46ea4f74c74108ba;hb=f0c7394d9bdae7e980847003f2da6dcc3d2ad96c;hp=4f05b88018d09fb3a06f2d7694be3254d1e866c5;hpb=9e83a47a9d9bd9a8020a80393e1f0e03bb34efe7;p=betaftpd diff --git a/cmds.c b/cmds.c index 4f05b88..a2e047b 100644 --- a/cmds.c +++ b/cmds.c @@ -141,6 +141,10 @@ #include #include +#if WANT_DCACHE +#include +#endif + #define lstat stat extern struct conn *first_conn; @@ -1226,23 +1230,7 @@ void do_listing(struct conn * const c, struct list_options * const lo) #endif #if WANT_DCACHE - /* populate the directory listing cache */ - { - struct stat buf; - struct dcache *d = alloc_new_dcache(); - if (d != NULL && stat(cwd, &buf) > -1) { - d->use_count++; - f->dir_cache = d; - d->dir_data = f->file_data; - d->dir_size = f->size; - d->generated = buf.st_mtime; - - strcpy(d->dir_name, cwd); - strncpy(d->pattern, ptr, 255); - d->pattern[255] = 0; - d->lo = *lo; - } - } + populate_dcache(f, cwd, ptr, lo); #endif #if HAVE_MMAP