Compare commits

..

No commits in common. "2afa403c8c27a9257c73258c7ecd791d5f83080c" and "2ca20024237850d994a14c343c1d7b7db425642f" have entirely different histories.

2 changed files with 15 additions and 14 deletions

View File

@ -39,31 +39,33 @@ auto directory_iterator::fill_buffer(const remote::file_offset &offset,
}
try {
auto next_offset{offset + 1U};
std::string item_name;
struct stat u_stat{};
struct stat st{};
struct stat *pst = nullptr;
switch (offset) {
case 0:
case 0: {
item_name = ".";
} break;
case 1: {
item_name = offset == 0U ? "." : "..";
u_stat.st_mode = S_IFDIR | 0755;
u_stat.st_nlink = 2;
item_name = "..";
} break;
default: {
item_name = utils::path::strip_to_file_name(items_.at(offset).api_path);
const auto &item = items_[offset];
item_name = utils::path::strip_to_file_name(item.api_path);
populate_stat(item.api_path, item.size, item.meta, item.directory, &st);
pst = &st;
} break;
}
#if FUSE_USE_VERSION >= 30
if (filler_function(buffer, item_name.data(), &u_stat,
static_cast<off_t>(next_offset),
if (filler_function(buffer, item_name.data(), pst,
static_cast<off_t>(offset + 1),
FUSE_FILL_DIR_PLUS) != 0)
#else // FUSE_USE_VERSION < 30
if (filler_function(buffer, item_name.data(), &u_stat,
static_cast<off_t>(next_offset)) != 0)
if (filler_function(buffer, item_name.data(), pst,
static_cast<off_t>(offset + 1)) != 0)
#endif // FUSE_USE_VERSION >= 30
{
errno = ENOMEM;

View File

@ -1790,5 +1790,4 @@ auto remote_server::update_to_windows_format(const std::string &root_api_path,
return item;
}
} // namespace repertory::remote_fuse
#endif // _WIN32