Compare commits
2 Commits
2ca2002423
...
2afa403c8c
Author | SHA1 | Date | |
---|---|---|---|
2afa403c8c | |||
d09210d9c4 |
@ -39,33 +39,31 @@ auto directory_iterator::fill_buffer(const remote::file_offset &offset,
|
||||
}
|
||||
|
||||
try {
|
||||
std::string item_name;
|
||||
struct stat st{};
|
||||
struct stat *pst = nullptr;
|
||||
switch (offset) {
|
||||
case 0: {
|
||||
item_name = ".";
|
||||
} break;
|
||||
auto next_offset{offset + 1U};
|
||||
|
||||
std::string item_name;
|
||||
struct stat u_stat{};
|
||||
|
||||
switch (offset) {
|
||||
case 0:
|
||||
case 1: {
|
||||
item_name = "..";
|
||||
item_name = offset == 0U ? "." : "..";
|
||||
u_stat.st_mode = S_IFDIR | 0755;
|
||||
u_stat.st_nlink = 2;
|
||||
} break;
|
||||
|
||||
default: {
|
||||
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;
|
||||
item_name = utils::path::strip_to_file_name(items_.at(offset).api_path);
|
||||
} break;
|
||||
}
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
if (filler_function(buffer, item_name.data(), pst,
|
||||
static_cast<off_t>(offset + 1),
|
||||
if (filler_function(buffer, item_name.data(), &u_stat,
|
||||
static_cast<off_t>(next_offset),
|
||||
FUSE_FILL_DIR_PLUS) != 0)
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
if (filler_function(buffer, item_name.data(), pst,
|
||||
static_cast<off_t>(offset + 1)) != 0)
|
||||
if (filler_function(buffer, item_name.data(), &u_stat,
|
||||
static_cast<off_t>(next_offset)) != 0)
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
{
|
||||
errno = ENOMEM;
|
||||
|
@ -1790,4 +1790,5 @@ auto remote_server::update_to_windows_format(const std::string &root_api_path,
|
||||
return item;
|
||||
}
|
||||
} // namespace repertory::remote_fuse
|
||||
|
||||
#endif // _WIN32
|
||||
|
Loading…
x
Reference in New Issue
Block a user