mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-11-26 18:31:12 +08:00
Merge pull request #299 from trapexit/realpath
use dynamic buffer for realpath
This commit is contained in:
commit
f7547d7cf5
|
@ -212,15 +212,16 @@ namespace fs
|
|||
realpathize(vector<string> &strs)
|
||||
{
|
||||
char *rv;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
for(size_t i = 0; i < strs.size(); i++)
|
||||
{
|
||||
rv = ::realpath(strs[i].c_str(),buf);
|
||||
rv = ::realpath(strs[i].c_str(),NULL);
|
||||
if(rv == NULL)
|
||||
continue;
|
||||
|
||||
strs[i] = buf;
|
||||
strs[i] = rv;
|
||||
|
||||
::free(rv);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user