From 5e6f21a9ff88664b4a67af9b1b4428b98fd6395f Mon Sep 17 00:00:00 2001 From: Jason Carpenter Date: Fri, 2 Feb 2024 20:24:40 -0800 Subject: [PATCH] fix: ListBucket edge cases (#2399) --- src/s3fs.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/s3fs.cpp b/src/s3fs.cpp index f2c529b..c746f6f 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -3370,10 +3370,9 @@ static int readdir_multi_head(const char* path, const S3ObjList& head, void* buf for(s3obj_list_t::iterator reiter = notfound_param.notfound_list.begin(); reiter != notfound_param.notfound_list.end(); ++reiter){ int dir_result; - if(0 == (dir_result = directory_empty(reiter->c_str()))){ + std::string dirpath = path + (*reiter); + if(-ENOTEMPTY == (dir_result = directory_empty(dirpath.c_str()))){ // Found objects under the path, so the path is directory. - // - std::string dirpath = path + (*reiter); // Add stat cache if(StatCache::getStatCacheData()->AddStat(dirpath, dummy_header, true)){ // set forcedir=true