From 4508b6d908a0242c4bbd6ef6fde5f3b28ee9d0aa Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 26 Jul 2025 11:04:59 -0500 Subject: [PATCH] fix . and .. incorrectly being reported as files --- .../fuse/remotefuse/remote_fuse_drive.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/repertory/librepertory/src/drives/fuse/remotefuse/remote_fuse_drive.cpp b/repertory/librepertory/src/drives/fuse/remotefuse/remote_fuse_drive.cpp index 6b5abd34..5d2245a8 100644 --- a/repertory/librepertory/src/drives/fuse/remotefuse/remote_fuse_drive.cpp +++ b/repertory/librepertory/src/drives/fuse/remotefuse/remote_fuse_drive.cpp @@ -401,29 +401,29 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf, if ((item_path == ".") || (item_path == "..")) { p_stat = std::make_unique(); if (item_path == ".") { - stat(get_mount_location().c_str(), p_stat.get()); + res = stat(get_mount_location().c_str(), p_stat.get()); } else { - stat(utils::path::get_parent_path(get_mount_location()).c_str(), - p_stat.get()); + res = stat(utils::path::get_parent_path(get_mount_location()).c_str(), + p_stat.get()); } - // p_stat->st_mode = S_IFDIR | 0755; - // p_stat->st_nlink = 2; } else { item_path = utils::path::strip_to_file_name(item_path); } + if (res == 0) { #if FUSE_USE_VERSION >= 30 - if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset, - FUSE_FILL_DIR_PLUS) != 0) { + if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset, + FUSE_FILL_DIR_PLUS) != 0) { #else // FUSE_USE_VERSION < 30 - if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset) != 0) { + if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset) != 0) { #endif // FUSE_USE_VERSION >= 30 - break; + break; + } } - } - if (res == -120) { - res = 0; + if (res == -120) { + res = 0; + } } return utils::to_api_error(res);