mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-09 16:06:46 +00:00
commit
cd280d8702
@ -933,8 +933,9 @@ static int s3fs_readlink(const char* _path, char* buf, size_t size)
|
|||||||
// check buf if it has space words.
|
// check buf if it has space words.
|
||||||
string strTmp = trim(string(buf));
|
string strTmp = trim(string(buf));
|
||||||
// decode wtf8. This will always be shorter
|
// decode wtf8. This will always be shorter
|
||||||
if (use_wtf8)
|
if(use_wtf8){
|
||||||
strTmp = s3fs_wtf8_decode(strTmp);
|
strTmp = s3fs_wtf8_decode(strTmp);
|
||||||
|
}
|
||||||
strcpy(buf, strTmp.c_str());
|
strcpy(buf, strTmp.c_str());
|
||||||
|
|
||||||
FdManager::get()->Close(ent);
|
FdManager::get()->Close(ent);
|
||||||
@ -2489,8 +2490,9 @@ static int readdir_multi_head(const char* path, S3ObjList& head, void* buf, fuse
|
|||||||
struct stat st;
|
struct stat st;
|
||||||
bool in_cache = StatCache::getStatCacheData()->GetStat((*iter), &st);
|
bool in_cache = StatCache::getStatCacheData()->GetStat((*iter), &st);
|
||||||
string bpath = mybasename((*iter));
|
string bpath = mybasename((*iter));
|
||||||
if (use_wtf8)
|
if(use_wtf8){
|
||||||
bpath = s3fs_wtf8_decode(bpath);
|
bpath = s3fs_wtf8_decode(bpath);
|
||||||
|
}
|
||||||
if(in_cache){
|
if(in_cache){
|
||||||
filler(buf, bpath.c_str(), &st, 0);
|
filler(buf, bpath.c_str(), &st, 0);
|
||||||
}else{
|
}else{
|
||||||
|
@ -472,8 +472,9 @@ bool s3fs_wtf8_encode(const char *s, string *result)
|
|||||||
|
|
||||||
// single byte encoding
|
// single byte encoding
|
||||||
if (c <= 0x7f) {
|
if (c <= 0x7f) {
|
||||||
if (result)
|
if (result) {
|
||||||
*result += c;
|
*result += c;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,14 +555,16 @@ bool s3fs_wtf8_decode(const char *s, string *result)
|
|||||||
if (code >= escape_base && code <= escape_base + 0xff) {
|
if (code >= escape_base && code <= escape_base + 0xff) {
|
||||||
// convert back
|
// convert back
|
||||||
encoded = true;
|
encoded = true;
|
||||||
if (result)
|
if(result){
|
||||||
*result += code - escape_base;
|
*result += code - escape_base;
|
||||||
|
}
|
||||||
s+=2;
|
s+=2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result)
|
if (result) {
|
||||||
*result += c;
|
*result += c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user