@@ -343,13 +343,15 @@ pathinfo->type = APPFS_PATHTYPE_DIRECTORY; sites = appfs_getsites(&sites_count); pathinfo->typeinfo.dir.childcount = sites_count; if (children) { + *children = NULL; for (site = sites; site; site = site->_next) { node = (void *) ckalloc(sizeof(*node)); node->_next = *children; + strcpy(node->name, site->name); *children = node; } } appfs_free_list_site(sites); @@ -403,14 +405,29 @@ return res; } static int appfs_fuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { + struct appfs_pathinfo pathinfo; + struct appfs_children *children, *child; + int res; + APPFS_DEBUG("Enter (path = %s, ...)", path); + + res = appfs_get_path_info(path, &pathinfo, &children); + if (res != 0) { + return(res); + } filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); + + for (child = children; child; child = child->_next) { + filler(buf, child->name, NULL, 0); + } + + appfs_free_list_children(children); return 0; } static int appfs_fuse_open(const char *path, struct fuse_file_info *fi) {