Allow listing implicit directories (#1986)

This fixes an issue when using -o notsup_compat_dir flag, dating back
to its introduction 3ac39d61f8.  The new
default exposed this in my local testing but a test runner bug masked
a test failure in test_external_directory_creation.  References #927.
References #1984.
This commit is contained in:
Andrew Gaul 2022-07-17 01:54:29 +09:00 committed by GitHub
parent 86da2eed3a
commit 4e163b2888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -427,7 +427,7 @@ static int get_object_attribute(const char* path, struct stat* pstbuf, headers_t
}
}
}
if(support_compat_dir && 0 != result && std::string::npos == strpath.find("_$folder$", 0)){
if(0 != result && std::string::npos == strpath.find("_$folder$", 0)){
// now path is "object" or "object/", do check "no dir object" which is not object but has only children.
if('/' == *strpath.rbegin()){
strpath.erase(strpath.length() - 1);
@ -440,7 +440,7 @@ static int get_object_attribute(const char* path, struct stat* pstbuf, headers_t
}
}
}else{
if(support_compat_dir && '/' != *strpath.rbegin() && std::string::npos == strpath.find("_$folder$", 0) && is_need_check_obj_detail(*pheader)){
if('/' != *strpath.rbegin() && std::string::npos == strpath.find("_$folder$", 0) && is_need_check_obj_detail(*pheader)){
// check a case of that "object" does not have attribute and "object" is possible to be directory.
if(-ENOTEMPTY == directory_empty(strpath.c_str())){
// found "no dir object".