mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-10 23:00:57 +00:00
Merge pull request #483 from ggtakec/master
Trim symbolic link original path in file.
This commit is contained in:
commit
f38aaa3d0e
11
src/s3fs.cpp
11
src/s3fs.cpp
@ -866,6 +866,10 @@ static int s3fs_readlink(const char* path, char* buf, size_t size)
|
|||||||
}
|
}
|
||||||
buf[ressize] = '\0';
|
buf[ressize] = '\0';
|
||||||
|
|
||||||
|
// check buf if it has space words.
|
||||||
|
string strTmp = trim(string(buf));
|
||||||
|
strcpy(buf, strTmp.c_str());
|
||||||
|
|
||||||
FdManager::get()->Close(ent);
|
FdManager::get()->Close(ent);
|
||||||
S3FS_MALLOCTRIM(0);
|
S3FS_MALLOCTRIM(0);
|
||||||
|
|
||||||
@ -1172,9 +1176,10 @@ static int s3fs_symlink(const char* from, const char* to)
|
|||||||
S3FS_PRN_ERR("could not open tmpfile(errno=%d)", errno);
|
S3FS_PRN_ERR("could not open tmpfile(errno=%d)", errno);
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
// write
|
// write(without space words)
|
||||||
ssize_t from_size = strlen(from);
|
string strFrom = trim(string(from));
|
||||||
if(from_size != ent->Write(from, 0, from_size)){
|
ssize_t from_size = static_cast<ssize_t>(strFrom.length());
|
||||||
|
if(from_size != ent->Write(strFrom.c_str(), 0, from_size)){
|
||||||
S3FS_PRN_ERR("could not write tmpfile(errno=%d)", errno);
|
S3FS_PRN_ERR("could not write tmpfile(errno=%d)", errno);
|
||||||
FdManager::get()->Close(ent);
|
FdManager::get()->Close(ent);
|
||||||
return -errno;
|
return -errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user